summaryrefslogtreecommitdiff
path: root/udevsend.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-11-12 06:18:28 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 22:24:30 -0700
commit13f24d596c5638443ffc7bc48c10a66758335c74 (patch)
treedb4de22cc3a09aa5a553f9ba2aa8e471b365f5b9 /udevsend.c
parentc6478ec1e128f0a92c2123ed110a651b88d43569 (diff)
[PATCH] remove udev_lib dependency from udevsend, which makes it smaller
Diffstat (limited to 'udevsend.c')
-rw-r--r--udevsend.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/udevsend.c b/udevsend.c
index 7db2378b83..9f324077b3 100644
--- a/udevsend.c
+++ b/udevsend.c
@@ -41,6 +41,9 @@
#include "udevd.h"
#include "logging.h"
+/* global variables */
+static int sock = -1;
+
#ifdef LOG
unsigned char logname[LOGNAME_SIZE];
void log_message (int level, const char *format, ...)
@@ -66,8 +69,7 @@ static int start_daemon(void)
switch (child_pid) {
case 0:
/* daemon */
- setsid();
- chdir("/");
+ close(sock);
execl(UDEVD_BIN, "udevd", NULL);
dbg("exec of daemon failed");
_exit(1);
@@ -119,7 +121,6 @@ int main(int argc, char *argv[], char *envp[])
int subsystem_env = 0;
int bufpos = 0;
int retval = 1;
- int sock = -1;
int started_daemon = 0;
logging_init("udevsend");
@@ -137,8 +138,6 @@ int main(int argc, char *argv[], char *envp[])
goto fallback;
}
- set_cloexec_flag(sock, 1);
-
memset(&saddr, 0x00, sizeof(struct sockaddr_un));
saddr.sun_family = AF_LOCAL;
/* use abstract namespace for socket path */