summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-04-05 00:08:10 +0200
committerKay Sievers <kay.sievers@suse.de>2006-04-05 00:08:10 +0200
commit7baada47bea60dd192067fd36778a77481a3ed3a (patch)
tree49677fa48a5470872a4b2d3c5858325d15a827b9 /udevd.c
parent2b3f8e93ca4fff33ae0885c01c0a1fc238e58f7f (diff)
udevd: export current seqnum and add udevsettle
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/udevd.c b/udevd.c
index 701165b9ad..8741a0901b 100644
--- a/udevd.c
+++ b/udevd.c
@@ -279,8 +279,23 @@ static void udev_event_run(struct uevent_msg *msg)
static void msg_queue_insert(struct uevent_msg *msg)
{
+ char filename[PATH_SIZE];
+ int fd;
+
msg->queue_time = time(NULL);
+ strlcpy(filename, udev_root, sizeof(filename));
+ strlcat(filename, "/" EVENT_SEQNUM, sizeof(filename));
+ fd = open(filename, O_WRONLY|O_TRUNC|O_CREAT, 0644);
+ if (fd > 0) {
+ char str[32];
+ int len;
+
+ len = sprintf(str, "%llu\n", msg->seqnum);
+ write(fd, str, len);
+ close(fd);
+ }
+
export_event_state(msg, EVENT_QUEUED);
/* run all events with a timeout set immediately */