summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-01-16 05:53:29 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:21:58 -0700
commit1e26698933e89c11dc6806d8bd37fd4386814239 (patch)
treeee3c89ca29941a4b2232985943a229fde3fba2c2
parentce043f851d4cb963cc0f566e590903dadb6c9fc1 (diff)
[PATCH] udevd: add possible initialization of expected_seqnum
UDEVD_EXPECTED_SEQNUM=$[`cat /sys/kernel/hotplug_seqnum` + 1] ./udevd -d will init udevd, so the next event will not wait for any timeout.
-rw-r--r--udevd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/udevd.c b/udevd.c
index 64abbe59a3..a8328bbb81 100644
--- a/udevd.c
+++ b/udevd.c
@@ -501,6 +501,7 @@ int main(int argc, char *argv[], char *envp[])
int fd;
struct sigaction act;
fd_set readfds;
+ const char *udevd_expected_seqnum;
logging_init("udevd");
dbg("version %s", UDEV_VERSION);
@@ -596,7 +597,14 @@ int main(int argc, char *argv[], char *envp[])
else
udev_bin = UDEV_BIN;
- /* handle special startup timeout*/
+ /* possible set of expected_seqnum number */
+ udevd_expected_seqnum = getenv("UDEVD_EXPECTED_SEQNUM");
+ if (udevd_expected_seqnum != NULL) {
+ expected_seqnum = strtoull(udevd_expected_seqnum, NULL, 10);
+ dbg("initialize expected_seqnum to %llu", expected_seqnum);
+ }
+
+ /* get current time to provide shorter startup timeout */
sysinfo(&info);
startup_time = info.uptime;