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 /util-linux | |
| parent | 73327a048b112ba2b742b758bb5a3caf95c7bf1a (diff) | |
| download | busybox-w32-bd77e9d6093dc8632788a3c3efffd53ac8ba3233.tar.gz busybox-w32-bd77e9d6093dc8632788a3c3efffd53ac8ba3233.tar.bz2 busybox-w32-bd77e9d6093dc8632788a3c3efffd53ac8ba3233.zip | |
mdev: improve logging
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'util-linux')
| -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 { | |||
| 283 | unsigned rule_idx; | 283 | unsigned rule_idx; |
| 284 | #endif | 284 | #endif |
| 285 | struct rule cur_rule; | 285 | struct rule cur_rule; |
| 286 | char timestr[sizeof("60.123456")]; | 286 | char timestr[sizeof("HH:MM:SS.123456")]; |
| 287 | } FIX_ALIASING; | 287 | } FIX_ALIASING; |
| 288 | #define G (*(struct globals*)&bb_common_bufsiz1) | 288 | #define G (*(struct globals*)&bb_common_bufsiz1) |
| 289 | #define INIT_G() do { \ | 289 | #define INIT_G() do { \ |
| @@ -923,7 +923,11 @@ static char *curtime(void) | |||
| 923 | { | 923 | { |
| 924 | struct timeval tv; | 924 | struct timeval tv; |
| 925 | gettimeofday(&tv, NULL); | 925 | gettimeofday(&tv, NULL); |
| 926 | sprintf(G.timestr, "%u.%06u", (unsigned)tv.tv_sec % 60, (unsigned)tv.tv_usec); | 926 | sprintf( |
| 927 | strftime_HHMMSS(G.timestr, sizeof(G.timestr), &tv.tv_sec), | ||
| 928 | ".%06u", | ||
| 929 | (unsigned)tv.tv_usec | ||
| 930 | ); | ||
| 927 | return G.timestr; | 931 | return G.timestr; |
| 928 | } | 932 | } |
| 929 | 933 | ||
| @@ -984,7 +988,7 @@ wait_for_seqfile(const char *seq) | |||
| 984 | break; | 988 | break; |
| 985 | } | 989 | } |
| 986 | if (do_once) { | 990 | if (do_once) { |
| 987 | dbg2("%s waiting for '%s'", curtime(), seqbuf); | 991 | dbg2("%s mdev.seq='%s', need '%s'", curtime(), seqbuf, seq); |
| 988 | do_once = 0; | 992 | do_once = 0; |
| 989 | } | 993 | } |
| 990 | if (sigtimedwait(&set_CHLD, NULL, &ts) >= 0) { | 994 | if (sigtimedwait(&set_CHLD, NULL, &ts) >= 0) { |
| @@ -992,7 +996,7 @@ wait_for_seqfile(const char *seq) | |||
| 992 | continue; /* don't decrement timeout! */ | 996 | continue; /* don't decrement timeout! */ |
| 993 | } | 997 | } |
| 994 | if (--timeout == 0) { | 998 | if (--timeout == 0) { |
| 995 | dbg1("%s waiting for '%s'", "timed out", seqbuf); | 999 | dbg1("%s mdev.seq='%s'", "timed out", seqbuf); |
| 996 | break; | 1000 | break; |
| 997 | } | 1001 | } |
| 998 | } | 1002 | } |
