From: Lennart Poettering Date: Fri, 27 Oct 2023 21:16:06 +0000 (+0200) Subject: sd-netlink: add call to query sd_event object an sd_netlink object is attached to X-Git-Tag: v255-rc1~43^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0adb58c3f19a347cd85d99c7dfd7f29965ec2ff8;p=thirdparty%2Fsystemd.git sd-netlink: add call to query sd_event object an sd_netlink object is attached to This mimics a similar call sd_bus_get_event() that already exists for sd-bus. --- diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c index 21a65e4dac0..898f11d1abb 100644 --- a/src/libsystemd/sd-netlink/sd-netlink.c +++ b/src/libsystemd/sd-netlink/sd-netlink.c @@ -761,6 +761,12 @@ int sd_netlink_detach_event(sd_netlink *nl) { return 0; } +sd_event* sd_netlink_get_event(sd_netlink *nl) { + assert_return(nl, NULL); + + return nl->event; +} + int netlink_add_match_internal( sd_netlink *nl, sd_netlink_slot **ret_slot, diff --git a/src/systemd/sd-netlink.h b/src/systemd/sd-netlink.h index 7edfeb76878..4119c453fb8 100644 --- a/src/systemd/sd-netlink.h +++ b/src/systemd/sd-netlink.h @@ -67,6 +67,7 @@ int sd_netlink_add_match(sd_netlink *nl, sd_netlink_slot **ret_slot, uint16_t ma int sd_netlink_attach_event(sd_netlink *nl, sd_event *e, int64_t priority); int sd_netlink_detach_event(sd_netlink *nl); +sd_event* sd_netlink_get_event(sd_netlink *nl); int sd_netlink_attach_filter(sd_netlink *nl, size_t len, const struct sock_filter *filter); /* Message construction */