* rewrite 14-11-2008 vda
*/
+//usage:#define timeout_trivial_usage
+//usage: "[-t SECS] [-s SIG] PROG ARGS"
+//usage:#define timeout_full_usage "\n\n"
+//usage: "Runs PROG. Sends SIG to it if it is not gone in SECS seconds.\n"
+//usage: "Defaults: SECS: 10, SIG: TERM."
+
#include "libbb.h"
int timeout_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
bb_daemonize_or_rexec(0, argv);
/* Here we are grandchild. Sleep, then kill grandparent */
grandchild:
- /* Just sleep(NUGE_NUM); kill(parent) may kill wrong process! */
+ /* Just sleep(HUGE_NUM); kill(parent) may kill wrong process! */
while (1) {
sleep(1);
if (--timeout <= 0)