]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-netlink: delete sd_netlink_new_from_fd()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 18 Aug 2022 12:24:14 +0000 (14:24 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 19 Aug 2022 09:52:25 +0000 (11:52 +0200)
It was somewhat similar to sd_netlink_open_fd(), and unused.

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

index 5da9294ebe592ec8e04221a0021f69d7c7824cdf..3510beea5becd34999258879772601845577530e 100644 (file)
@@ -792,7 +792,6 @@ global:
 
         sd_hwdb_new_from_path;
 
-        sd_netlink_new_from_fd;
         sd_netlink_open;
         sd_netlink_open_fd;
         sd_netlink_increase_rxbuf;
index d1e5e68996234c1e3b84cb3d84d1d6777835da3c..965235862cd9014eeda228590b77be8b0ebf205c 100644 (file)
@@ -69,31 +69,6 @@ static int netlink_new(sd_netlink **ret) {
         return 0;
 }
 
-_public_ int sd_netlink_new_from_fd(sd_netlink **ret, int fd) {
-        _cleanup_(sd_netlink_unrefp) sd_netlink *nl = NULL;
-        socklen_t addrlen;
-        int r;
-
-        assert_return(ret, -EINVAL);
-
-        r = netlink_new(&nl);
-        if (r < 0)
-                return r;
-
-        addrlen = sizeof(nl->sockaddr);
-
-        if (getsockname(fd, &nl->sockaddr.sa, &addrlen) < 0)
-                return -errno;
-
-        if (nl->sockaddr.nl.nl_family != AF_NETLINK)
-                return -EINVAL;
-
-        nl->fd = fd;
-
-        *ret = TAKE_PTR(nl);
-        return 0;
-}
-
 _public_ int sd_netlink_open_fd(sd_netlink **ret, int fd) {
         _cleanup_(sd_netlink_unrefp) sd_netlink *nl = NULL;
         int r, protocol;
index 45c2ffb47eb5a775891a760681c3a3c8516437a0..51b553a6f8aca14755a48d1da79f9bc328cd2321 100644 (file)
@@ -40,7 +40,6 @@ typedef int (*sd_netlink_message_handler_t)(sd_netlink *nl, sd_netlink_message *
 typedef _sd_destroy_t sd_netlink_destroy_t;
 
 /* bus */
-int sd_netlink_new_from_fd(sd_netlink **ret, int fd);
 int sd_netlink_open(sd_netlink **ret);
 int sd_netlink_open_fd(sd_netlink **ret, int fd);
 int sd_netlink_increase_rxbuf(sd_netlink *nl, const size_t size);