diff options
author | Kay Sievers <kay.sievers@suse.de> | 2006-08-05 13:24:05 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2006-08-05 13:24:05 +0200 |
commit | 239cc98b80b614be2c7079c153c6a1dc2cdaa7e8 (patch) | |
tree | 09d417d6ed295d79ef4c7bcf924a824e0840eb61 /udevd.c | |
parent | b3518c16e3c3795a5ff278ef4c71f8e439057d6d (diff) |
initialize unused sockets to -1
Diffstat (limited to 'udevd.c')
-rw-r--r-- | udevd.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } |