summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-04-03 19:22:07 +0200
committerThomas Haller <thaller@redhat.com>2023-04-04 08:43:20 +0200
commit17ae6a4413a886d95a74abd972cd5b0c4744a9b7 (patch)
tree3ae5990986fc5da55d774050033ca31d9217c49a
parent20bd6b68036b9696d39c96cb0c1600c42d8d4255 (diff)
downloadNetworkManager-17ae6a4413a886d95a74abd972cd5b0c4744a9b7.tar.gz
platform: drop unused nl_socket_set_nonblocking() function
It's not used. It's better to use SOCK_NONBLOCK flag for socket(), as we do. Also, the implementation that blindly calls F_SETFL without merging the existing flags from F_GETFL is just wrong. Drop it altogether.
-rw-r--r--src/libnm-platform/nm-netlink.c11
-rw-r--r--src/libnm-platform/nm-netlink.h2
-rw-r--r--src/libnm-platform/tests/test-nm-platform.c1
3 files changed, 0 insertions, 14 deletions
diff --git a/src/libnm-platform/nm-netlink.c b/src/libnm-platform/nm-netlink.c
index 00b6880abb..5684b8cda5 100644
--- a/src/libnm-platform/nm-netlink.c
+++ b/src/libnm-platform/nm-netlink.c
@@ -1037,17 +1037,6 @@ nlmsg_get_dst(struct nl_msg *msg)
}
int
-nl_socket_set_nonblocking(const struct nl_sock *sk)
-{
- nm_assert_sk(sk);
-
- if (fcntl(sk->s_fd, F_SETFL, O_NONBLOCK) < 0)
- return -nm_errno_from_native(errno);
-
- return 0;
-}
-
-int
nl_socket_set_buffer_size(struct nl_sock *sk, int rxbuf, int txbuf)
{
int err;
diff --git a/src/libnm-platform/nm-netlink.h b/src/libnm-platform/nm-netlink.h
index 6fed8189b7..35e2962984 100644
--- a/src/libnm-platform/nm-netlink.h
+++ b/src/libnm-platform/nm-netlink.h
@@ -605,8 +605,6 @@ int nl_socket_set_passcred(struct nl_sock *sk, int state);
int nl_socket_set_pktinfo(struct nl_sock *sk, int state);
-int nl_socket_set_nonblocking(const struct nl_sock *sk);
-
uint32_t nl_socket_get_local_port(const struct nl_sock *sk);
int nl_socket_add_memberships(struct nl_sock *sk, int group, ...);
diff --git a/src/libnm-platform/tests/test-nm-platform.c b/src/libnm-platform/tests/test-nm-platform.c
index 90a2904599..5fc8a5dded 100644
--- a/src/libnm-platform/tests/test-nm-platform.c
+++ b/src/libnm-platform/tests/test-nm-platform.c
@@ -117,7 +117,6 @@ test_use_symbols(void)
(void (*)(void)) nl_socket_set_passcred,
(void (*)(void)) nl_socket_set_msg_buf_size,
(void (*)(void)) nlmsg_get_dst,
- (void (*)(void)) nl_socket_set_nonblocking,
(void (*)(void)) nl_socket_set_buffer_size,
(void (*)(void)) nl_socket_add_memberships,
(void (*)(void)) nl_wait_for_ack,