diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c index 8adef477328..45e45162ae5 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_unref(uctrl->event_source_connect); + uctrl->event_source_connect = sd_event_source_disable_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_unref(uctrl->event_source); + sd_event_source_disable_unref(uctrl->event_source); safe_close(uctrl->sock); sd_event_unref(uctrl->event); @@ -323,7 +323,7 @@ int udev_ctrl_send(UdevCtrl *uctrl, UdevCtrlMessageType type, const void *data) } int udev_ctrl_wait(UdevCtrl *uctrl, usec_t timeout) { - _cleanup_(sd_event_source_unrefp) sd_event_source *source_io = NULL, *source_timeout = NULL; + _cleanup_(sd_event_source_disable_unrefp) sd_event_source *source_io = NULL, *source_timeout = NULL; int r; assert(uctrl); diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c index 76fbbc1954f..d9af8bfd203 100644 --- a/src/udev/udev-event.c +++ b/src/udev/udev-event.c @@ -695,9 +695,9 @@ static int on_spawn_sigchld(sd_event_source *s, const siginfo_t *si, void *userd static int spawn_wait(Spawn *spawn) { _cleanup_(sd_event_unrefp) sd_event *e = NULL; - _cleanup_(sd_event_source_unrefp) sd_event_source *sigchld_source = NULL; - _cleanup_(sd_event_source_unrefp) sd_event_source *stdout_source = NULL; - _cleanup_(sd_event_source_unrefp) sd_event_source *stderr_source = NULL; + _cleanup_(sd_event_source_disable_unrefp) sd_event_source *sigchld_source = NULL; + _cleanup_(sd_event_source_disable_unrefp) sd_event_source *stdout_source = NULL; + _cleanup_(sd_event_source_disable_unrefp) sd_event_source *stderr_source = NULL; int r; assert(spawn); diff --git a/src/udev/udevd.c b/src/udev/udevd.c index 0407068d511..6bb9eeb4bb3 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -165,8 +165,8 @@ static Event *event_free(Event *event) { sd_device_unref(event->dev); sd_device_unref(event->dev_kernel); - sd_event_source_unref(event->timeout_warning_event); - sd_event_source_unref(event->timeout_event); + sd_event_source_disable_unref(event->timeout_warning_event); + sd_event_source_disable_unref(event->timeout_event); if (event->worker) event->worker->event = NULL; @@ -208,8 +208,8 @@ DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(worker_hash_op, void, trivial_hash static void manager_clear_for_worker(Manager *manager) { assert(manager); - manager->inotify_event = sd_event_source_unref(manager->inotify_event); - manager->kill_workers_event = sd_event_source_unref(manager->kill_workers_event); + manager->inotify_event = sd_event_source_disable_unref(manager->inotify_event); + manager->kill_workers_event = sd_event_source_disable_unref(manager->kill_workers_event); manager->event = sd_event_unref(manager->event); @@ -306,7 +306,7 @@ static void manager_exit(Manager *manager) { /* close sources of new events and discard buffered events */ manager->ctrl = udev_ctrl_unref(manager->ctrl); - manager->inotify_event = sd_event_source_unref(manager->inotify_event); + manager->inotify_event = sd_event_source_disable_unref(manager->inotify_event); manager->inotify_fd = safe_close(manager->inotify_fd); manager->monitor = sd_device_monitor_unref(manager->monitor);