mirror of
https://github.com/systemd/systemd.git
synced 2025-02-04 21:47:31 +03:00
sd-netlink: delete sd_netlink_new_from_fd()
It was somewhat similar to sd_netlink_open_fd(), and unused.
This commit is contained in:
parent
24c0f38591
commit
3310e0647c
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user