]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-event: introduce event_source_disable()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 13 Nov 2018 04:34:44 +0000 (13:34 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 16 Nov 2018 13:57:42 +0000 (22:57 +0900)
src/libsystemd/sd-event/event-util.c
src/libsystemd/sd-event/event-util.h

index 2da5592bd019c4a09216a14f62895ec4f0ae93c5..4f3a2fec31c2e89a900d0dfb1e3496f28f6cf527 100644 (file)
@@ -80,3 +80,10 @@ int event_reset_time(
 
         return created;
 }
+
+int event_source_disable(sd_event_source *s) {
+        if (!s)
+                return 0;
+
+        return sd_event_source_set_enabled(s, SD_EVENT_OFF);
+}
index aa9411e2ff74f6887936dd73832edfaa64ffe7fe..7f9cced5a3e4359961ab41345ec194964a75a8a9 100644 (file)
@@ -9,3 +9,4 @@ int event_reset_time(sd_event *e, sd_event_source **s,
                      clockid_t clock, uint64_t usec, uint64_t accuracy,
                      sd_event_time_handler_t callback, void *userdata,
                      int64_t priority, const char *description, bool force_reset);
+int event_source_disable(sd_event_source *s);