]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: fix creation of floating event_add_time_change() event sources
authorLennart Poettering <lennart@poettering.net>
Mon, 21 Mar 2022 17:15:42 +0000 (18:15 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 21 Mar 2022 21:57:36 +0000 (21:57 +0000)
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

src/libsystemd/sd-event/event-util.c

index 4d0d780741aa72d824ea728c04ee5a2746c9acb4..8c24e7db635ffe9b836683a23115442a5079a3f1 100644 (file)
@@ -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;