From: Yu Watanabe Date: Tue, 13 Nov 2018 04:34:44 +0000 (+0900) Subject: sd-event: introduce event_source_disable() X-Git-Tag: v240~300^2~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2701983ce8ee0a6b6a4885ca7e2e8dd4c2586594;p=thirdparty%2Fsystemd.git sd-event: introduce event_source_disable() --- diff --git a/src/libsystemd/sd-event/event-util.c b/src/libsystemd/sd-event/event-util.c index 2da5592bd01..4f3a2fec31c 100644 --- a/src/libsystemd/sd-event/event-util.c +++ b/src/libsystemd/sd-event/event-util.c @@ -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); +} diff --git a/src/libsystemd/sd-event/event-util.h b/src/libsystemd/sd-event/event-util.h index aa9411e2ff7..7f9cced5a3e 100644 --- a/src/libsystemd/sd-event/event-util.h +++ b/src/libsystemd/sd-event/event-util.h @@ -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);