udev_device_add_tag(udev_device, tag);
}
}
+ } else if (strncmp(property, "USEC_INITIALIZED=", 19) == 0) {
+ udev_device_set_usec_initialized(udev_device, strtoull(&property[19], NULL, 10));
} else if (strncmp(property, "DRIVER=", 7) == 0) {
udev_device_set_driver(udev_device, &property[7]);
} else if (strncmp(property, "ACTION=", 7) == 0) {
void udev_device_set_usec_initialized(struct udev_device *udev_device, unsigned long long usec_initialized)
{
+ char num[32];
+
udev_device->usec_initialized = usec_initialized;
+ snprintf(num, sizeof(num), "%llu", usec_initialized);
+ udev_device_add_property(udev_device, "USEC_INITIALIZED", num);
}
/**
/* 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
+ else if (udev_device_get_usec_initialized(event->dev) == 0)
udev_device_set_usec_initialized(event->dev, now_usec());
/* (re)write database file */
dev = udev_monitor_receive_device(monitor);
if (dev != NULL)
+ udev_device_set_usec_initialized(dev, now_usec());
if (event_queue_insert(dev) < 0)
udev_device_unref(dev);
}