diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-10-04 18:11:47 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-10-04 18:11:47 +0000 |
commit | a0dbf69b83e932370562948146f08195c6cf130d (patch) | |
tree | 17a991124026a7f4aa44bba8c2a34eee4a2f8947 /contrib/package/freifunk-watchdog/src/watchdog.h | |
parent | 32acbdde47c5b0064da6618e693c8a77e48d3aec (diff) |
contrib/package: reap zombies in freifunk-watchdog, fix a warning
Diffstat (limited to 'contrib/package/freifunk-watchdog/src/watchdog.h')
-rw-r--r-- | contrib/package/freifunk-watchdog/src/watchdog.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/contrib/package/freifunk-watchdog/src/watchdog.h b/contrib/package/freifunk-watchdog/src/watchdog.h index 6d9ccf82c6..71c10e9c1f 100644 --- a/contrib/package/freifunk-watchdog/src/watchdog.h +++ b/contrib/package/freifunk-watchdog/src/watchdog.h @@ -29,6 +29,7 @@ #include <math.h> #include <time.h> #include <signal.h> +#include <sys/wait.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/socket.h> @@ -67,7 +68,7 @@ /* System load error action and treshold */ #define LOAD_TRESHOLD 15.00 -#define LOAD_ACTION "/sbin/reboot" +#define LOAD_ACTION "/sbin/reboot", "/sbin/reboot" /* Fallback binary name (passed by makefile) */ #ifndef BINARY @@ -107,22 +108,20 @@ iw_ioctl(int skfd, /* Socket to the kernel */ } /* fork() & execl() helper */ -#define EXEC(x) \ - do { \ - switch(fork()) \ - { \ - case -1: \ - syslog(LOG_CRIT, "Unable to fork child: %s", \ - strerror(errno)); \ - \ - break; \ - \ - case 0: \ - execl(x, NULL); \ - syslog(LOG_CRIT, "Unable to execute action: %s", \ - strerror(errno)); \ - \ - return 1; \ - } \ +#define EXEC(x) \ + do { \ + switch(fork()) \ + { \ + case -1: \ + syslog(LOG_CRIT, "Unable to fork child: %s", \ + strerror(errno)); \ + break; \ + \ + case 0: \ + execl(x, NULL); \ + syslog(LOG_CRIT, "Unable to execute action: %s", \ + strerror(errno)); \ + return 1; \ + } \ } while(0) |