X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=udevd.c;h=8741a0901b1752e6088c5887c97f0dbd6bf9ea28;hp=701165b9ad0df601ecb53dcf53480843634ae0f9;hb=7baada47bea60dd192067fd36778a77481a3ed3a;hpb=2b3f8e93ca4fff33ae0885c01c0a1fc238e58f7f diff --git a/udevd.c b/udevd.c index 701165b9a..8741a0901 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 */