diff options
-rw-r--r-- | udev/udev-ctrl.c | 9 | ||||
-rw-r--r-- | udev/udev.h | 1 | ||||
-rw-r--r-- | udev/udevd.c | 5 |
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); |