diff options
author | N.N. <matju@users.sourceforge.net> | 2010-01-05 22:49:36 +0000 |
---|---|---|
committer | N.N. <matju@users.sourceforge.net> | 2010-01-05 22:49:36 +0000 |
commit | 8dbec761cf858ea65900c8a094599857208d8c3a (patch) | |
tree | 3228c023f87f23a354da3b57fdc2afe5b7052032 /desiredata/src/s_watchdog.c | |
parent | 529e59635598e2d90a7a49f6b4c676f8366109ba (diff) |
svn path=/trunk/; revision=12907
Diffstat (limited to 'desiredata/src/s_watchdog.c')
-rw-r--r-- | desiredata/src/s_watchdog.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/desiredata/src/s_watchdog.c b/desiredata/src/s_watchdog.c deleted file mode 100644 index 49bffbb6..00000000 --- a/desiredata/src/s_watchdog.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright (c) 1997-2000 Miller Puckette. -* For information on usage and redistribution, and for a DISCLAIMER OF ALL -* WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ - -/* This file is compiled into the separate program, "pd-watchdog," which -tries to prevent Pd from locking up the processor if it's at realtime -priority. Linux only. Invoked from s_inter.c. */ - -#include <sys/time.h> -#include <sys/types.h> -#include <unistd.h> -#include <signal.h> -#include <stdio.h> - -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; - continue; - } - happy = 0; - kill(getppid(), SIGHUP); - fprintf(stderr, "watchdog: signaling pd...\n"); - } -} |