summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-10-10 00:38:56 +0200
committerKay Sievers <kay.sievers@vrfy.org>2011-10-10 00:38:56 +0200
commit1f5a5100f3bdfdaf9ef71b29931574b678ff0d82 (patch)
tree6fdc320d9076e9d3c9931d3110fbe19f37cc5a8e /udev
parent5cc4112e6d326436dab7476ccc17588d42bf782f (diff)
downloadsystemd-1f5a5100f3bdfdaf9ef71b29931574b678ff0d82.tar.gz
udevd: control - no not delete socket file when --daemon is used
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-ctrl.c9
-rw-r--r--udev/udev.h1
-rw-r--r--udev/udevd.c5
3 files changed, 11 insertions, 4 deletions
diff --git a/udev/udev-ctrl.c b/udev/udev-ctrl.c
index 43484cc838..4bca807b69 100644
--- a/udev/udev-ctrl.c
+++ b/udev/udev-ctrl.c
@@ -156,12 +156,17 @@ struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl)
return uctrl;
if (uctrl->sock >= 0)
close(uctrl->sock);
- if (uctrl->cleanup_socket)
- unlink(uctrl->saddr.sun_path);
free(uctrl);
return NULL;
}
+int udev_ctrl_cleanup(struct udev_ctrl *uctrl)
+{
+ if (uctrl->cleanup_socket)
+ unlink(uctrl->saddr.sun_path);
+ return 0;
+}
+
int udev_ctrl_get_fd(struct udev_ctrl *uctrl)
{
if (uctrl == NULL)
diff --git a/udev/udev.h b/udev/udev.h
index 402c738aee..eaba4ed341 100644
--- a/udev/udev.h
+++ b/udev/udev.h
@@ -102,6 +102,7 @@ struct udev_ctrl *udev_ctrl_new_from_fd(struct udev *udev, int fd);
int udev_ctrl_enable_receiving(struct udev_ctrl *uctrl);
struct udev_ctrl *udev_ctrl_ref(struct udev_ctrl *uctrl);
struct udev_ctrl *udev_ctrl_unref(struct udev_ctrl *uctrl);
+int udev_ctrl_cleanup(struct udev_ctrl *uctrl);
struct udev *udev_ctrl_get_udev(struct udev_ctrl *uctrl);
int udev_ctrl_get_fd(struct udev_ctrl *uctrl);
int udev_ctrl_send_set_log_level(struct udev_ctrl *uctrl, int priority, int timeout);
diff --git a/udev/udevd.c b/udev/udevd.c
index fdb3e42002..60edea98e1 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -1420,7 +1420,7 @@ int main(int argc, char *argv[])
goto exit;
default:
rc = EXIT_SUCCESS;
- goto exit_keep_queue;
+ goto exit_daemonize;
}
setsid();
@@ -1704,7 +1704,8 @@ int main(int argc, char *argv[])
rc = EXIT_SUCCESS;
exit:
udev_queue_export_cleanup(udev_queue_export);
-exit_keep_queue:
+ udev_ctrl_cleanup(udev_ctrl);
+exit_daemonize:
if (fd_ep >= 0)
close(fd_ep);
worker_list_cleanup(udev);