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:
Zbigniew Jędrzejewski-Szmek
2022-06-30 10:35:27 +02:00
parent 7d9337ed77
commit 71193c0b62
6 changed files with 17 additions and 22 deletions
+1 -1
View File
@@ -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;