From: Lennart Poettering Date: Mon, 21 Mar 2022 17:15:42 +0000 (+0100) Subject: sd-event: fix creation of floating event_add_time_change() event sources X-Git-Tag: v251-rc1~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a321e0e4630518c547b42a1854d076a9fbe19a91;p=thirdparty%2Fsystemd.git sd-event: fix creation of floating event_add_time_change() event sources We shouldn't auto-disable event sources we create in "floating" mode. Hence don#t use the disabling destructor for event sources. Given that noone else has access to this event source we just allocated anyway there's no point in explicitly disabling it before freeing it. Follow-up for ec75e8e07a0ad972e0c40e0a187e15a8d4fb3d66 --- diff --git a/src/libsystemd/sd-event/event-util.c b/src/libsystemd/sd-event/event-util.c index 4d0d780741a..8c24e7db635 100644 --- a/src/libsystemd/sd-event/event-util.c +++ b/src/libsystemd/sd-event/event-util.c @@ -124,7 +124,7 @@ int event_source_is_enabled(sd_event_source *s) { } int event_add_time_change(sd_event *e, sd_event_source **ret, sd_event_io_handler_t callback, void *userdata) { - _cleanup_(sd_event_source_disable_unrefp) sd_event_source *s = NULL; + _cleanup_(sd_event_source_unrefp) sd_event_source *s = NULL; _cleanup_close_ int fd = -1; int r;