aboutsummaryrefslogtreecommitdiffstats
path: root/src/ntp_server.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-08-29 10:18:50 +0200
committerMax Kellermann <max@duempel.org>2011-08-29 10:18:54 +0200
commit59a5b000e03a17fd1708bb912a20ea198e5d1539 (patch)
treec4aa7b8101dbc0025e0f9cbdf79aceb52e140c30 /src/ntp_server.c
parentd49a2ccb08ad71bde6716a916f9284e0e0548f63 (diff)
downloadmpd-59a5b000e03a17fd1708bb912a20ea198e5d1539.tar.gz
mpd-59a5b000e03a17fd1708bb912a20ea198e5d1539.tar.xz
mpd-59a5b000e03a17fd1708bb912a20ea198e5d1539.zip
ntp_server: check for select() failures
Fix freeze after signal was handled.
Diffstat (limited to 'src/ntp_server.c')
-rw-r--r--src/ntp_server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ntp_server.c b/src/ntp_server.c
index 0705c7fc9..8e4aca6bd 100644
--- a/src/ntp_server.c
+++ b/src/ntp_server.c
@@ -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");