diff options
Diffstat (limited to 'pd/src/s_watchdog.c')
-rw-r--r-- | pd/src/s_watchdog.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pd/src/s_watchdog.c b/pd/src/s_watchdog.c index 2602334d..d595773c 100644 --- a/pd/src/s_watchdog.c +++ b/pd/src/s_watchdog.c @@ -18,7 +18,7 @@ int main(int argc, char **argv) while (1) { struct timeval timout; - fd_set readset; + fd_set readset, exceptset; if (happy) { timout.tv_sec = 5; @@ -31,7 +31,11 @@ int main(int argc, char **argv) } FD_ZERO(&readset); FD_SET(0, &readset); - select(1, &readset, 0, 0, &timout); + FD_ZERO(&exceptset); + FD_SET(0, &exceptset); + select(1, &readset, 0, &exceptset, &timout); + if (FD_ISSET(0, &exceptset)) + return (0); if (FD_ISSET(0, &readset)) { char buf[100]; |