ntp_server: check for select() failures

Fix freeze after signal was handled.
This commit is contained in:
Max Kellermann 2011-08-29 10:18:50 +02:00
parent d49a2ccb08
commit 59a5b000e0
1 changed files with 3 additions and 1 deletions

View File

@ -112,7 +112,9 @@ ntp_server_check(struct ntp_server *ntp, struct timeval *tout)
FD_SET(ntp->fd, &rdfds);
fdmax = ntp->fd;
select(fdmax + 1, &rdfds,NULL, NULL, tout);
if (select(fdmax + 1, &rdfds,NULL, NULL, tout) <= 0)
return false;
if (FD_ISSET(ntp->fd, &rdfds)) {
if (!ntp_server_handle(ntp)) {
g_debug("unable to send timing response\n");