From 29bbefe42883a660c6769f042e7bafdf151d720b Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Mon, 11 Jul 2011 22:56:07 +0200 Subject: [PATCH] udevd: use 'uptime' in debug timestamp --- udev/udevd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/udev/udevd.c b/udev/udevd.c index e7384e19..968b4166 100644 --- a/udev/udevd.c +++ b/udev/udevd.c @@ -55,13 +55,12 @@ static void log_fn(struct udev *udev, int priority, { if (debug) { char buf[1024]; - struct timeval tv; - struct timezone tz; + struct timespec ts; vsnprintf(buf, sizeof(buf), format, args); - gettimeofday(&tv, &tz); + clock_gettime(CLOCK_MONOTONIC, &ts); fprintf(stderr, "%llu.%06u [%u] %s: %s", - (unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec, + (unsigned long long) ts.tv_sec, (unsigned int) ts.tv_nsec/1000, (int) getpid(), fn, buf); } else { vsyslog(priority, format, args); -- 2.39.5