chiark / gitweb /
udevd: control - no not delete socket file when --daemon is used
[elogind.git] / udev / udev-ctrl.c
index 43484cc..4bca807 100644 (file)
@@ -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)