diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2011-12-27 03:49:43 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2011-12-27 03:49:43 +0100 |
commit | 4f1795cca7060030461c8f3429e5a62f143f74a9 (patch) | |
tree | 53ca617100f3ef014c790e40f3f6f81a2d7cd409 /libudev/libudev-util.c | |
parent | d1aacc0fa997a9757adc923792a6c17753d05084 (diff) |
move rules dirs to udev context; replace inotify with time-controlled stat()
Diffstat (limited to 'libudev/libudev-util.c')
-rw-r--r-- | libudev/libudev-util.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libudev/libudev-util.c b/libudev/libudev-util.c index e08349e0fa..5369fe734e 100644 --- a/libudev/libudev-util.c +++ b/libudev/libudev-util.c @@ -552,12 +552,17 @@ uint64_t util_string_bloom64(const char *str) #define USEC_PER_SEC 1000000ULL #define NSEC_PER_USEC 1000ULL +unsigned long long ts_usec(const struct timespec *ts) +{ + return (unsigned long long) ts->tv_sec * USEC_PER_SEC + + (unsigned long long) ts->tv_nsec / NSEC_PER_USEC; +} + unsigned long long now_usec(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) return 0; - return (unsigned long long) ts.tv_sec * USEC_PER_SEC + - (unsigned long long) ts.tv_nsec / NSEC_PER_USEC; + return ts_usec(&ts); } |