From 71193c0b629c76ec511dd222d6b68a52c4df132d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 14 Jun 2022 14:37:21 +0200 Subject: sd-event: allow sd_event_source_is_enabled() to return false for NULL This is a natural use case, and instead of defining a wrapper to do this for us, let's just make this part of the API. Calling with NULL was not allowed, so this is not a breaking change to the interface. (After sd_event_source_is_enabled was originally added, we introduced sd_event_source_disable_unref() and other similar functions which accept NULL. So not accepting NULL here is likely to confuse people. Let's just make the API usable with minimal fuss.) --- man/sd_event_source_set_enabled.xml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'man/sd_event_source_set_enabled.xml') diff --git a/man/sd_event_source_set_enabled.xml b/man/sd_event_source_set_enabled.xml index c8ae169c17..d6cdf85eda 100644 --- a/man/sd_event_source_set_enabled.xml +++ b/man/sd_event_source_set_enabled.xml @@ -68,13 +68,15 @@ loop wakeups and will not be dispatched, until they are enabled again. - sd_event_source_get_enabled() may be - used to query whether the event source object - source is currently enabled or not. It - returns the enablement state (one of SD_EVENT_ON, - SD_EVENT_OFF, SD_EVENT_ONESHOT) - in enabled, if it is not NULL. - It also returns true if the event source is not disabled. + sd_event_source_get_enabled() may be used to query whether the event source + object source is currently enabled or not. If both the + source and the output parameter enabled are + NULL, this function returns false. Otherwise, source must be + a valid pointer to an sd_event_source object. If the output parameter + enabled is not NULL, it is set to the enablement state (one + of SD_EVENT_ON, SD_EVENT_OFF, + SD_EVENT_ONESHOT). The function also returns true if the event source is not + disabled. Event source objects are enabled when they are first created with calls such as -- cgit v1.2.1