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:
parent
701b9415a5
commit
d7a444593f
1 changed files with 2 additions and 1 deletions
3
ntp_io.c
3
ntp_io.c
|
@ -332,7 +332,8 @@ NIO_OpenServerSocket(NTP_Remote_Address *remote_addr)
|
|||
static int
|
||||
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);
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
|
Loading…
Reference in a new issue