summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-event.c5
-rw-r--r--src/udev/udevd.c4
2 files changed, 3 insertions, 6 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index f62c1eaf47..3a165b0b4f 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -873,10 +873,7 @@ void udev_event_execute_rules(struct udev_event *event,
}
/* preserve old, or get new initialization timestamp */
- if (event->dev_db != NULL && udev_device_get_usec_initialized(event->dev_db) > 0)
- udev_device_set_usec_initialized(event->dev, udev_device_get_usec_initialized(event->dev_db));
- else if (udev_device_get_usec_initialized(event->dev) == 0)
- udev_device_set_usec_initialized(event->dev, now(CLOCK_MONOTONIC));
+ udev_device_ensure_usec_initialized(event->dev, event->dev_db);
/* (re)write database file */
udev_device_update_db(dev);
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index f7d61915fb..8eaf2cdc8c 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1474,8 +1474,8 @@ int main(int argc, char *argv[]) {
struct udev_device *dev;
dev = udev_monitor_receive_device(monitor);
- if (dev != NULL) {
- udev_device_set_usec_initialized(dev, now(CLOCK_MONOTONIC));
+ if (dev) {
+ udev_device_ensure_usec_initialized(dev, NULL);
if (event_queue_insert(dev) < 0)
udev_device_unref(dev);
}