diff options
author | Wincent Balin <wincent@rockbox.org> | 2010-06-03 00:39:13 +0000 |
---|---|---|
committer | Wincent Balin <wincent@rockbox.org> | 2010-06-03 00:39:13 +0000 |
commit | c1ae4414d4ac6504992434b949b252c30daf0c48 (patch) | |
tree | 696c5781e9a00cea694117eb3ef404d37f10930e /apps/plugins/pdbox/PDa/src/s_watchdog.c | |
parent | 5edd8cf736232a240e2f4f47eb847e1901d18379 (diff) | |
download | rockbox-c1ae4414d4ac6504992434b949b252c30daf0c48.tar.gz rockbox-c1ae4414d4ac6504992434b949b252c30daf0c48.zip |
pdbox: Source cleanup. Removed unneeded files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26497 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pdbox/PDa/src/s_watchdog.c')
-rw-r--r-- | apps/plugins/pdbox/PDa/src/s_watchdog.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/apps/plugins/pdbox/PDa/src/s_watchdog.c b/apps/plugins/pdbox/PDa/src/s_watchdog.c deleted file mode 100644 index e8653e9e39..0000000000 --- a/apps/plugins/pdbox/PDa/src/s_watchdog.c +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* Copyright (c) 1997-2000 Miller Puckette. | ||
2 | * For information on usage and redistribution, and for a DISCLAIMER OF ALL | ||
3 | * WARRANTIES, see the file, "LICENSE.txt," in this distribution. */ | ||
4 | |||
5 | /* This file is compiled into the separate program, "pd-watchdog," which | ||
6 | tries to prevent Pd from locking up the processor if it's at realtime | ||
7 | priority. Linux only. Invoked from s_inter.c. */ | ||
8 | |||
9 | #include <sys/time.h> | ||
10 | #include <sys/types.h> | ||
11 | #include <unistd.h> | ||
12 | #include <signal.h> | ||
13 | #include <stdio.h> | ||
14 | |||
15 | int main(int argc, char **argv) | ||
16 | { | ||
17 | int happy = 1; | ||
18 | while (1) | ||
19 | { | ||
20 | struct timeval timout; | ||
21 | fd_set readset; | ||
22 | if (happy) | ||
23 | { | ||
24 | timout.tv_sec = 5; | ||
25 | timout.tv_usec = 0; | ||
26 | } | ||
27 | else | ||
28 | { | ||
29 | timout.tv_sec = 2; | ||
30 | timout.tv_usec = 0; | ||
31 | } | ||
32 | FD_ZERO(&readset); | ||
33 | FD_SET(0, &readset); | ||
34 | select(1, &readset, 0, 0, &timout); | ||
35 | if (FD_ISSET(0, &readset)) | ||
36 | { | ||
37 | char buf[100]; | ||
38 | happy = 1; | ||
39 | if (read(0, &buf, 100) <= 0) | ||
40 | return (0); | ||
41 | else continue; | ||
42 | } | ||
43 | happy = 0; | ||
44 | kill(getppid(), SIGHUP); | ||
45 | fprintf(stderr, "watchdog: signaling pd...\n"); | ||
46 | } | ||
47 | } | ||
48 | |||