diff --git a/src/utilities/guard/guard.cpp b/src/utilities/guard/guard.cpp index 2727bdf257..b8016f7b91 100644 --- a/src/utilities/guard/guard.cpp +++ b/src/utilities/guard/guard.cpp @@ -92,6 +92,7 @@ int CLIB_ROUTINE main( int argc, char **argv) const TEXT* prog_name = argv[0]; const TEXT* pidfilename = 0; int guard_exit_code = 0; + int timeout_term = 3; const TEXT* const* const end = argc + argv; argv++; @@ -116,9 +117,13 @@ int CLIB_ROUTINE main( int argc, char **argv) case 'P': pidfilename = *argv++; break; + case 'T': + timeout_term = atoi(*argv++); + break; default: fprintf(stderr, - "Usage: %s [-signore | -onetime | -forever (default)] [-daemon] [-pidfile filename]\n", + "Usage: %s [-signore | -onetime | -forever (default)] [-daemon] [-pidfile filename] " + "[-timeout seconds (default 3)]\n", prog_name); exit(-1); break; @@ -224,7 +229,7 @@ int CLIB_ROUTINE main( int argc, char **argv) { if (shutdown_child) { - ret_code = UTIL_shutdown_child(child_pid, 3, 1); + ret_code = UTIL_shutdown_child(child_pid, timeout_term, 1); if (ret_code < 0) { gds__log("%s: error while shutting down %s (%d)\n",