summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-08-17 21:05:18 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-08-17 21:05:18 +0200
commita20a57a7bfbc6edd7602c135ca78f3e56878badb (patch)
tree4460dac44dfccd5f5e380de17c0b28de8bc79711 /libudev
parentcdfdc85fb5728c844460c67641bea7197e104b12 (diff)
export USEC_INITIALIZED= and take timestamp on message receive time
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libudev/libudev-device.c b/libudev/libudev-device.c
index 273e5cb59c..064ffad9bf 100644
--- a/libudev/libudev-device.c
+++ b/libudev/libudev-device.c
@@ -437,6 +437,8 @@ void udev_device_add_property_from_string_parse(struct udev_device *udev_device,
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) {
@@ -1322,7 +1324,11 @@ unsigned long long udev_device_get_usec_initialized(struct udev_device *udev_dev
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);
}
/**