diff --git a/ntp_io.c b/ntp_io.c index 5847956..f947237 100644 --- a/ntp_io.c +++ b/ntp_io.c @@ -98,7 +98,7 @@ open_socket(int family, int local_port, int client_only, IPSockAddr *remote_addr sock_flags = SCK_FLAG_RX_DEST_ADDR | SCK_FLAG_PRIV_BIND; if (!client_only) - sock_flags |= SCK_FLAG_NONBLOCK | SCK_FLAG_BROADCAST; + sock_flags |= SCK_FLAG_BROADCAST; sock_fd = SCK_OpenUdpSocket(remote_addr, &local_addr, sock_flags); if (sock_fd < 0) { diff --git a/socket.c b/socket.c index 5a2a511..7d28d7a 100644 --- a/socket.c +++ b/socket.c @@ -160,8 +160,8 @@ open_socket(int domain, int type, int flags) return INVALID_SOCK_FD; } - /* Enable non-blocking mode if requested */ - if (flags & SCK_FLAG_NONBLOCK && fcntl(sock_fd, F_SETFL, O_NONBLOCK)) { + /* Enable non-blocking mode */ + if (fcntl(sock_fd, F_SETFL, O_NONBLOCK)) { DEBUG_LOG("Could not set O_NONBLOCK : %s", strerror(errno)); close(sock_fd); return INVALID_SOCK_FD; diff --git a/socket.h b/socket.h index 54ec5a6..b394918 100644 --- a/socket.h +++ b/socket.h @@ -31,7 +31,6 @@ #include "addressing.h" /* Flags for opening sockets */ -#define SCK_FLAG_NONBLOCK 1 #define SCK_FLAG_BROADCAST 2 #define SCK_FLAG_RX_DEST_ADDR 4 #define SCK_FLAG_ALL_PERMISSIONS 8