diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-04-05 00:08:10 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-04-05 00:08:10 +0200 |
commit | 7baada47bea60dd192067fd36778a77481a3ed3a (patch) | |
tree | 49677fa48a5470872a4b2d3c5858325d15a827b9 /udevd.c | |
parent | 2b3f8e93ca4fff33ae0885c01c0a1fc238e58f7f (diff) |
udevd: export current seqnum and add udevsettle
Diffstat (limited to 'udevd.c')
-rw-r--r-- | udevd.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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 */ |