diff options
author | Max Kellermann <max@duempel.org> | 2011-08-29 10:18:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-08-29 10:18:54 +0200 |
commit | 59a5b000e03a17fd1708bb912a20ea198e5d1539 (patch) | |
tree | c4aa7b8101dbc0025e0f9cbdf79aceb52e140c30 /src/ntp_server.c | |
parent | d49a2ccb08ad71bde6716a916f9284e0e0548f63 (diff) | |
download | mpd-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.c | 4 |
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"); |