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.
This commit is contained in:
Thomas Haller 2023-04-03 19:22:07 +02:00
parent 20bd6b6803
commit 17ae6a4413
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
3 changed files with 0 additions and 14 deletions

View file

@ -1036,17 +1036,6 @@ nlmsg_get_dst(struct nl_msg *msg)
return &msg->nm_dst;
}
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)
{

View file

@ -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, ...);

View file

@ -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,