diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-09 19:10:49 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-09 19:10:49 +0100 |
commit | dc698bb038756a926aaa529bda1b939eab2c1676 (patch) | |
tree | 4084a40897d9d81816228935a1398e80dd4b173b /runit/svlogd.c | |
parent | 0681137972dc89b5003b0415e09184c0ecf1c875 (diff) | |
download | busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.tar.gz busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.tar.bz2 busybox-w32-dc698bb038756a926aaa529bda1b939eab2c1676.zip |
*: make it easier to distinquish "struct tm", pointer to one, etc
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'runit/svlogd.c')
-rw-r--r-- | runit/svlogd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/runit/svlogd.c b/runit/svlogd.c index fe40cd890..f556c7db5 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c | |||
@@ -266,18 +266,18 @@ static char* wstrdup(const char *str) | |||
266 | /* NUL terminated */ | 266 | /* NUL terminated */ |
267 | static void fmt_time_human_30nul(char *s) | 267 | static void fmt_time_human_30nul(char *s) |
268 | { | 268 | { |
269 | struct tm *t; | 269 | struct tm *ptm; |
270 | struct timeval tv; | 270 | struct timeval tv; |
271 | 271 | ||
272 | gettimeofday(&tv, NULL); | 272 | gettimeofday(&tv, NULL); |
273 | t = gmtime(&(tv.tv_sec)); | 273 | ptm = gmtime(&tv.tv_sec); |
274 | sprintf(s, "%04u-%02u-%02u_%02u:%02u:%02u.%06u000", | 274 | sprintf(s, "%04u-%02u-%02u_%02u:%02u:%02u.%06u000", |
275 | (unsigned)(1900 + t->tm_year), | 275 | (unsigned)(1900 + ptm->tm_year), |
276 | (unsigned)(t->tm_mon + 1), | 276 | (unsigned)(ptm->tm_mon + 1), |
277 | (unsigned)(t->tm_mday), | 277 | (unsigned)(ptm->tm_mday), |
278 | (unsigned)(t->tm_hour), | 278 | (unsigned)(ptm->tm_hour), |
279 | (unsigned)(t->tm_min), | 279 | (unsigned)(ptm->tm_min), |
280 | (unsigned)(t->tm_sec), | 280 | (unsigned)(ptm->tm_sec), |
281 | (unsigned)(tv.tv_usec) | 281 | (unsigned)(tv.tv_usec) |
282 | ); | 282 | ); |
283 | /* 4+1 + 2+1 + 2+1 + 2+1 + 2+1 + 2+1 + 9 = */ | 283 | /* 4+1 + 2+1 + 2+1 + 2+1 + 2+1 + 2+1 + 9 = */ |