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.)
This commit is contained in:
@@ -405,7 +405,7 @@ static int peer_resolve_endpoint(WireguardPeer *peer) {
|
||||
/* Not necessary to resolve the endpoint. */
|
||||
return 0;
|
||||
|
||||
if (event_source_is_enabled(peer->resolve_retry_event_source) > 0)
|
||||
if (sd_event_source_get_enabled(peer->resolve_retry_event_source, NULL) > 0)
|
||||
/* Timer event source is enabled. The endpoint will be resolved later. */
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user