summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/udev/udev-ctrl.c4
-rw-r--r--src/udev/udevd.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index 4913d0262b..528641d956 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -101,7 +101,7 @@ static void udev_ctrl_disconnect(UdevCtrl *uctrl) {
if (!uctrl)
return;
- uctrl->event_source_connect = sd_event_source_disable_unref(uctrl->event_source_connect);
+ uctrl->event_source_connect = sd_event_source_unref(uctrl->event_source_connect);
uctrl->sock_connect = safe_close(uctrl->sock_connect);
}
@@ -110,7 +110,7 @@ static UdevCtrl *udev_ctrl_free(UdevCtrl *uctrl) {
udev_ctrl_disconnect(uctrl);
- sd_event_source_disable_unref(uctrl->event_source);
+ sd_event_source_unref(uctrl->event_source);
safe_close(uctrl->sock);
sd_event_unref(uctrl->event);
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 0a888993c8..1cde6b9c9c 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -178,8 +178,10 @@ static Event *event_free(Event *event) {
LIST_REMOVE(event, event->manager->events, event);
sd_device_unref(event->dev);
- sd_event_source_disable_unref(event->timeout_warning_event);
- sd_event_source_disable_unref(event->timeout_event);
+ /* Do not use sd_event_source_disable_unref() here, as this is called by both workers and the
+ * main process. */
+ sd_event_source_unref(event->timeout_warning_event);
+ sd_event_source_unref(event->timeout_event);
if (event->worker)
event->worker->event = NULL;