1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00

udevadm: monitor - use uptime to match the kernel's timestamp

This commit is contained in:
Kay Sievers 2011-07-11 01:03:14 +02:00
parent ce60b80f87
commit 2315e57070
2 changed files with 4 additions and 6 deletions

2
TODO
View File

@ -2,8 +2,6 @@
- test (now fixed) /dev/tape/ links
- monitor: use clock MONOTONIC
- remove RUN+="socket:"
- libudev: return proper errno or set errno

View File

@ -24,6 +24,7 @@
#include <errno.h>
#include <signal.h>
#include <getopt.h>
#include <time.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/un.h>
@ -43,13 +44,12 @@ static void sig_handler(int signum)
static void print_device(struct udev_device *device, const char *source, int prop)
{
struct timeval tv;
struct timezone tz;
struct timespec ts;
gettimeofday(&tv, &tz);
clock_gettime(CLOCK_MONOTONIC, &ts);
printf("%-6s[%llu.%06u] %-8s %s (%s)\n",
source,
(unsigned long long) tv.tv_sec, (unsigned int) tv.tv_usec,
(unsigned long long) ts.tv_sec, (unsigned int) ts.tv_nsec/1000,
udev_device_get_action(device),
udev_device_get_devpath(device),
udev_device_get_subsystem(device));