Skip to content

Commit

Permalink
global/variables: add g_ prefix to some global variables
Browse files Browse the repository at this point in the history
Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 2, 2024
1 parent d95180e commit 5f083c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 6 additions & 4 deletions drivers/syslog/syslog_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ static ssize_t syslog_default_write(FAR struct syslog_channel_s *channel,
* Private Data
****************************************************************************/

#ifdef CONFIG_ARCH_LOWPUTC
static mutex_t g_lowputs_lock = NXMUTEX_INITIALIZER;
#endif

#if defined(CONFIG_RAMLOG_SYSLOG)
static const struct syslog_channel_ops_s g_ramlog_channel_ops =
{
Expand Down Expand Up @@ -236,13 +240,11 @@ static ssize_t syslog_default_write(FAR struct syslog_channel_s *channel,
FAR const char *buffer, size_t buflen)
{
#if defined(CONFIG_ARCH_LOWPUTC)
static mutex_t lock = NXMUTEX_INITIALIZER;

nxmutex_lock(&lock);
nxmutex_lock(&g_lowputs_lock);

up_nputs(buffer, buflen);

nxmutex_unlock(&lock);
nxmutex_unlock(&g_lowputs_lock);
#endif

UNUSED(channel);
Expand Down
9 changes: 7 additions & 2 deletions libs/libc/time/lib_gmtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@

#include <nuttx/clock.h>

/****************************************************************************
* Private Data
****************************************************************************/

static struct tm g_gmtime;

/****************************************************************************
* Public Functions
****************************************************************************/
Expand All @@ -44,8 +50,7 @@

FAR struct tm *gmtime(FAR const time_t *timep)
{
static struct tm tm;
return gmtime_r(timep, &tm);
return gmtime_r(timep, &g_gmtime);
}

FAR struct tm *localtime(FAR const time_t *timep)
Expand Down

0 comments on commit 5f083c6

Please sign in to comment.