diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2015-04-19 18:54:49 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2015-04-19 18:54:49 +0200 |
commit | bd77e9d6093dc8632788a3c3efffd53ac8ba3233 (patch) | |
tree | 7125e52fa2c2ce7f92d34176febfea2e70e22b1c | |
parent | 73327a048b112ba2b742b758bb5a3caf95c7bf1a (diff) | |
download | busybox-bd77e9d6093dc8632788a3c3efffd53ac8ba3233.tar.gz |
mdev: improve logging
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | util-linux/mdev.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/util-linux/mdev.c b/util-linux/mdev.c index ccc00d365..884e5de33 100644 --- a/util-linux/mdev.c +++ b/util-linux/mdev.c @@ -283,7 +283,7 @@ struct globals { unsigned rule_idx; #endif struct rule cur_rule; - char timestr[sizeof("60.123456")]; + char timestr[sizeof("HH:MM:SS.123456")]; } FIX_ALIASING; #define G (*(struct globals*)&bb_common_bufsiz1) #define INIT_G() do { \ @@ -923,7 +923,11 @@ static char *curtime(void) { struct timeval tv; gettimeofday(&tv, NULL); - sprintf(G.timestr, "%u.%06u", (unsigned)tv.tv_sec % 60, (unsigned)tv.tv_usec); + sprintf( + strftime_HHMMSS(G.timestr, sizeof(G.timestr), &tv.tv_sec), + ".%06u", + (unsigned)tv.tv_usec + ); return G.timestr; } @@ -984,7 +988,7 @@ wait_for_seqfile(const char *seq) break; } if (do_once) { - dbg2("%s waiting for '%s'", curtime(), seqbuf); + dbg2("%s mdev.seq='%s', need '%s'", curtime(), seqbuf, seq); do_once = 0; } if (sigtimedwait(&set_CHLD, NULL, &ts) >= 0) { @@ -992,7 +996,7 @@ wait_for_seqfile(const char *seq) continue; /* don't decrement timeout! */ } if (--timeout == 0) { - dbg1("%s waiting for '%s'", "timed out", seqbuf); + dbg1("%s mdev.seq='%s'", "timed out", seqbuf); break; } } |