summaryrefslogtreecommitdiff
path: root/udevd.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-08-05 13:24:05 +0200
committerKay Sievers <kay.sievers@suse.de>2006-08-05 13:24:05 +0200
commit239cc98b80b614be2c7079c153c6a1dc2cdaa7e8 (patch)
tree09d417d6ed295d79ef4c7bcf924a824e0840eb61 /udevd.c
parentb3518c16e3c3795a5ff278ef4c71f8e439057d6d (diff)
initialize unused sockets to -1
Diffstat (limited to 'udevd.c')
-rw-r--r--udevd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/udevd.c b/udevd.c
index b221692944..eae66255f2 100644
--- a/udevd.c
+++ b/udevd.c
@@ -47,9 +47,9 @@
#include "udevd.h"
static struct udev_rules rules;
-static int udevd_sock;
-static int uevent_netlink_sock;
-static int inotify_fd;
+static int udevd_sock = -1;
+static int uevent_netlink_sock = -1;
+static int inotify_fd = -1;
static pid_t sid;
static int signal_pipe[2] = {-1, -1};
@@ -770,6 +770,8 @@ static int init_udevd_socket(void)
retval = bind(udevd_sock, (struct sockaddr *) &saddr, addrlen);
if (retval < 0) {
err("bind failed: %s", strerror(errno));
+ close(udevd_sock);
+ udevd_sock = -1;
return -1;
}