diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-11-07 02:22:44 +0100 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-11-07 02:22:44 +0100 |
commit | 0b3dfb3d72e1df5f38ecb9669e37e5e77d958343 (patch) | |
tree | 6196e26a8f176d6445823ed27e3e5972069923d8 /udevsend.c | |
parent | 1ad45a47cae79a80bb9c9ff287dc46c18b2ddc71 (diff) |
udevd: depend on netlink and remove all sequence reorder logic
Netlink will never get out-of-order and we just depend on it from
now on. Udevsend messages will have no effect if they contain a
sequence number (SEQNUM).
Thanks to Bastian Blank <waldi@debian.org>, for the debugging session
which identified a bug where the timeouts are not working if
inotify was not available. All the timeout handling is removed
now and this issue should be solved.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udevsend.c')
-rw-r--r-- | udevsend.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/udevsend.c b/udevsend.c index 0ba1b58a4b..29d5bc155e 100644 --- a/udevsend.c +++ b/udevsend.c @@ -89,27 +89,6 @@ static int start_daemon(void) return 0; } -static void run_udev(const char *subsystem) -{ - char *const argv[] = { "udev", (char *)subsystem, NULL }; - pid_t pid; - - pid = fork(); - switch (pid) { - case 0: - /* child */ - execv(UDEV_BIN, argv); - err("exec of udev child failed"); - _exit(1); - break; - case -1: - err("fork of udev child failed"); - break; - default: - waitpid(pid, NULL, 0); - } -} - int main(int argc, char *argv[], char *envp[]) { static struct udevd_msg usend_msg; @@ -132,7 +111,7 @@ int main(int argc, char *argv[], char *envp[]) sock = socket(AF_LOCAL, SOCK_DGRAM, 0); if (sock == -1) { err("error getting socket"); - goto fallback; + goto exit; } memset(&saddr, 0x00, sizeof(struct sockaddr_un)); @@ -192,7 +171,7 @@ int main(int argc, char *argv[], char *envp[]) if (errno != ECONNREFUSED) { err("error sending message (%s)", strerror(errno)); - goto fallback; + goto exit; } if (!started_daemon) { @@ -200,7 +179,7 @@ int main(int argc, char *argv[], char *envp[]) retval = start_daemon(); if (retval) { dbg("error starting daemon"); - goto fallback; + goto exit; } dbg("udevd daemon started"); started_daemon = 1; @@ -210,10 +189,6 @@ int main(int argc, char *argv[], char *envp[]) } } -fallback: - err("unable to connect to event daemon, try to call udev directly"); - run_udev(subsystem); - exit: if (sock != -1) close(sock); |