]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: add call to query sd_event object an sd_netlink object is attached to
authorLennart Poettering <lennart@poettering.net>
Fri, 27 Oct 2023 21:16:06 +0000 (23:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 2 Nov 2023 13:19:32 +0000 (14:19 +0100)
This mimics a similar call sd_bus_get_event() that already exists for
sd-bus.

src/libsystemd/sd-netlink/sd-netlink.c
src/systemd/sd-netlink.h

index 21a65e4dac0ac9a2caa39faa62c5b4fc8b74c4de..898f11d1abba75889bea3fc46fd9bc21661bb0e4 100644 (file)
@@ -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,
index 7edfeb76878be4ac693cbc82abe18e16d76d4f92..4119c453fb8525b1131275c689f9c16cb81207ac 100644 (file)
@@ -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 */