diff options
author | Miller Puckette <millerpuckette@users.sourceforge.net> | 2004-09-06 20:20:36 +0000 |
---|---|---|
committer | Miller Puckette <millerpuckette@users.sourceforge.net> | 2004-09-06 20:20:36 +0000 |
commit | ed932acb5860bf8b9296169676499562a55d139e (patch) | |
tree | dc6a40dba908deb07c175cd40ee19c197318f72d /pd/src/s_watchdog.c | |
parent | dad636821f6e7d3ead02c157f308c0ceeba9af3d (diff) |
checking in version 0.38test5.
Oops, I realize I forgot some more nice files, will add them and re-commit.
svn path=/trunk/; revision=2010
Diffstat (limited to 'pd/src/s_watchdog.c')
-rw-r--r-- | pd/src/s_watchdog.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/pd/src/s_watchdog.c b/pd/src/s_watchdog.c index a2122824..2602334d 100644 --- a/pd/src/s_watchdog.c +++ b/pd/src/s_watchdog.c @@ -17,31 +17,31 @@ int main(int argc, char **argv) int happy = 1; while (1) { - struct timeval timout; - fd_set readset; - if (happy) - { - timout.tv_sec = 5; - timout.tv_usec = 0; - } - else - { - timout.tv_sec = 2; - timout.tv_usec = 0; - } - FD_ZERO(&readset); - FD_SET(0, &readset); - select(1, &readset, 0, 0, &timout); - if (FD_ISSET(0, &readset)) - { - char buf[100]; - happy = 1; - if (read(0, &buf, 100) <= 0) - return (0); - else continue; - } - happy = 0; - kill(getppid(), SIGHUP); - fprintf(stderr, "watchdog: signaling pd...\n"); + struct timeval timout; + fd_set readset; + if (happy) + { + timout.tv_sec = 5; + timout.tv_usec = 0; + } + else + { + timout.tv_sec = 2; + timout.tv_usec = 0; + } + FD_ZERO(&readset); + FD_SET(0, &readset); + select(1, &readset, 0, 0, &timout); + if (FD_ISSET(0, &readset)) + { + char buf[100]; + happy = 1; + if (read(0, &buf, 100) <= 0) + return (0); + else continue; + } + happy = 0; + kill(getppid(), SIGHUP); + fprintf(stderr, "watchdog: signaling pd...\n"); } } |