summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-27 12:32:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:45 -0500
commit2f28844a1099d16607b6b54d382b2fb9e2ba64a2 (patch)
tree39c4b3305e77545cec54c90c768d7ab3ef0c7154 /source3
parent4f655c952bc18625b76f07e81518016cba7eee77 (diff)
downloadsamba-2f28844a1099d16607b6b54d382b2fb9e2ba64a2.tar.gz
samba-2f28844a1099d16607b6b54d382b2fb9e2ba64a2.tar.bz2
samba-2f28844a1099d16607b6b54d382b2fb9e2ba64a2.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 (This used to be commit b120c21669a91a097f044530a1f7c59043465841)
Diffstat (limited to 'source3')
-rw-r--r--source3/script/tests/timelimit.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/script/tests/timelimit.c b/source3/script/tests/timelimit.c
index af8ff27454..dc11720ec1 100644
--- a/source3/script/tests/timelimit.c
+++ b/source3/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 {