mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 10:45:07 -05:00
ntp: improve check for PTP socket
Check for INVALID_SOCK_FD in case the PTP port is enabled, but opening one of the PTP sockets failed.
This commit is contained in:
3
ntp_io.c
3
ntp_io.c
@@ -332,7 +332,8 @@ NIO_OpenServerSocket(NTP_Remote_Address *remote_addr)
|
|||||||
static int
|
static int
|
||||||
is_ptp_socket(int sock_fd)
|
is_ptp_socket(int sock_fd)
|
||||||
{
|
{
|
||||||
return ptp_port > 0 && (sock_fd == ptp_sock_fd4 || sock_fd == ptp_sock_fd6);
|
return ptp_port > 0 && sock_fd != INVALID_SOCK_FD &&
|
||||||
|
(sock_fd == ptp_sock_fd4 || sock_fd == ptp_sock_fd6);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user