svn commit: samba r14745 - in trunk/source/script/tests: .

metze at samba.org metze at samba.org
Mon Mar 27 12:33:55 GMT 2006


Author: metze
Date: 2006-03-27 12:33:55 +0000 (Mon, 27 Mar 2006)
New Revision: 14745

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14745

Log:
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
Modified:
   trunk/source/script/tests/timelimit.c


Changeset:
Modified: trunk/source/script/tests/timelimit.c
===================================================================
--- trunk/source/script/tests/timelimit.c	2006-03-27 12:32:42 UTC (rev 14744)
+++ trunk/source/script/tests/timelimit.c	2006-03-27 12:33:55 UTC (rev 14745)
@@ -22,17 +22,25 @@
 	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 @@
 
 	signal(SIGTERM, sig_term);
 	signal(SIGUSR1, sig_usr1);
-	signal(SIGALRM, sig_alrm);
+	signal(SIGALRM, sig_alrm_term);
 	alarm(maxtime);
 
 	do {



More information about the samba-cvs mailing list