[PD-cvs] pd/src s_watchdog.c,1.2,1.2.12.1
Mathieu Bouchard
matju at users.sourceforge.net
Wed Jul 11 21:05:16 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10859
Modified Files:
Tag: desiredata
s_watchdog.c
Log Message:
cleanup (just reformatting)
Index: s_watchdog.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/s_watchdog.c,v
retrieving revision 1.2
retrieving revision 1.2.12.1
diff -C2 -d -r1.2 -r1.2.12.1
*** s_watchdog.c 6 Sep 2004 20:20:36 -0000 1.2
--- s_watchdog.c 11 Jul 2007 19:05:14 -0000 1.2.12.1
***************
*** 13,30 ****
#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;
--- 13,25 ----
#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;
***************
*** 33,47 ****
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");
}
}
--- 28,40 ----
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");
}
}
More information about the Pd-cvs
mailing list