diff options
author | Ron Yorston <rmy@pobox.com> | 2018-03-15 08:49:48 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2018-03-15 08:49:48 +0000 |
commit | 6fe4ad9a6c96624c2b75c0d51b035bc1a71d9eba (patch) | |
tree | bb7620a3217f5adf6fb5f3358b2b89a97331b5e8 /runit | |
parent | f3d24e08a385a68c4bacb284bd8a8e3da7f0f4b3 (diff) | |
parent | bbe47d9b9aee3824845f1ce08c9caeb262c15059 (diff) | |
download | busybox-w32-6fe4ad9a6c96624c2b75c0d51b035bc1a71d9eba.tar.gz busybox-w32-6fe4ad9a6c96624c2b75c0d51b035bc1a71d9eba.tar.bz2 busybox-w32-6fe4ad9a6c96624c2b75c0d51b035bc1a71d9eba.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'runit')
-rw-r--r-- | runit/svlogd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runit/svlogd.c b/runit/svlogd.c index 412290ca9..13de2570f 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c | |||
@@ -347,11 +347,13 @@ static unsigned pmatch(const char *p, const char *s, unsigned len) | |||
347 | /* NUL terminated */ | 347 | /* NUL terminated */ |
348 | static void fmt_time_human_30nul(char *s, char dt_delim) | 348 | static void fmt_time_human_30nul(char *s, char dt_delim) |
349 | { | 349 | { |
350 | struct tm tm; | ||
350 | struct tm *ptm; | 351 | struct tm *ptm; |
351 | struct timeval tv; | 352 | struct timeval tv; |
352 | 353 | ||
353 | gettimeofday(&tv, NULL); | 354 | gettimeofday(&tv, NULL); |
354 | ptm = gmtime(&tv.tv_sec); | 355 | ptm = gmtime_r(&tv.tv_sec, &tm); |
356 | /* ^^^ using gmtime_r() instead of gmtime() to not use static data */ | ||
355 | sprintf(s, "%04u-%02u-%02u%c%02u:%02u:%02u.%06u000", | 357 | sprintf(s, "%04u-%02u-%02u%c%02u:%02u:%02u.%06u000", |
356 | (unsigned)(1900 + ptm->tm_year), | 358 | (unsigned)(1900 + ptm->tm_year), |
357 | (unsigned)(ptm->tm_mon + 1), | 359 | (unsigned)(ptm->tm_mon + 1), |