diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-03-27 12:32:42 +0000 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2006-03-27 12:32:42 +0000 |
commit | ce5a6ad19c08d0e5909b55876ed410c07212df4a (patch) | |
tree | 15bdf873e86174c7958b8fafc1f4538177d5c65f /source | |
parent | e00babe1b4b15303325da6e9dc99c45283c4cbc0 (diff) | |
download | samba-ce5a6ad19c08d0e5909b55876ed410c07212df4a.tar.gz samba-ce5a6ad19c08d0e5909b55876ed410c07212df4a.tar.xz samba-ce5a6ad19c08d0e5909b55876ed410c07212df4a.zip |
r14744: allow ./timelimit 5 ./timelimit 20 ./ignore_all_signals
to work,
this is needed when we enable samba3's make test
in the build-farm
metze
Diffstat (limited to 'source')
-rw-r--r-- | source/script/tests/timelimit.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/script/tests/timelimit.c b/source/script/tests/timelimit.c index af8ff274545..dc11720ec1b 100644 --- a/source/script/tests/timelimit.c +++ b/source/script/tests/timelimit.c @@ -22,17 +22,25 @@ static void usage(void) printf(" SIGTERM - passes SIGTERM to command's process group and exit(0)\n"); } -static void sig_alrm(int sig) +static void sig_alrm_kill(int sig) { fprintf(stderr, "\nMaximum time expired in timelimit - killing\n"); kill(-child_pid, SIGKILL); exit(1); } +static void sig_alrm_term(int sig) +{ + kill(-child_pid, SIGTERM); + alarm(5); + signal(SIGALRM, sig_alrm_kill); +} + static void sig_term(int sig) { kill(-child_pid, SIGTERM); - exit(0); + alarm(1); + signal(SIGALRM, sig_alrm_kill); } static void sig_usr1(int sig) @@ -78,7 +86,7 @@ int main(int argc, char *argv[]) signal(SIGTERM, sig_term); signal(SIGUSR1, sig_usr1); - signal(SIGALRM, sig_alrm); + signal(SIGALRM, sig_alrm_term); alarm(maxtime); do { |