mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 18:25:07 -05:00
ntp: enable non-blocking mode on server sockets
Avoid blocking in sendmsg() due to a full send buffer.
This commit is contained in:
4
ntp_io.c
4
ntp_io.c
@@ -142,6 +142,10 @@ prepare_socket(int family, int port_number, int client_only)
|
|||||||
/* Close on exec */
|
/* Close on exec */
|
||||||
UTI_FdSetCloexec(sock_fd);
|
UTI_FdSetCloexec(sock_fd);
|
||||||
|
|
||||||
|
/* Enable non-blocking mode on server sockets */
|
||||||
|
if (!client_only && fcntl(sock_fd, F_SETFL, O_NONBLOCK))
|
||||||
|
DEBUG_LOG("Could not set O_NONBLOCK : %s", strerror(errno));
|
||||||
|
|
||||||
/* Prepare local address */
|
/* Prepare local address */
|
||||||
memset(&my_addr, 0, sizeof (my_addr));
|
memset(&my_addr, 0, sizeof (my_addr));
|
||||||
my_addr_len = 0;
|
my_addr_len = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user