diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2010-12-15 08:57:46 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2010-12-15 08:58:46 +0100 |
commit | 9c6a11b1c6c68dabfd28b72d361da0e1930c7321 (patch) | |
tree | 581eed5eeb14013c6ec4e9669ed14d6ed69d107e /udev | |
parent | 93a724d3f8afc4b6fe5c7c9642c79df724324ed3 (diff) |
libudev: record and export "age" of device record
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-event.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/udev/udev-event.c b/udev/udev-event.c index 4d38c5b893..100a79c1e8 100644 --- a/udev/udev-event.c +++ b/udev/udev-event.c @@ -643,6 +643,13 @@ int udev_event_execute_rules(struct udev_event *event, struct udev_rules *rules) err = udev_node_add(dev, event->mode, event->uid, event->gid); } + /* 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 + udev_device_set_usec_initialized(event->dev, usec_monotonic()); + + /* (re)write database file */ udev_device_update_db(dev); udev_device_tag_index(dev, event->dev_db, true); udev_device_set_is_initialized(dev); |