svn commit: r259167 - user/pho/stress2/misc

Peter Holm pho at FreeBSD.org
Tue Dec 10 11:47:39 UTC 2013


Author: pho
Date: Tue Dec 10 11:47:38 2013
New Revision: 259167
URL: http://svnweb.freebsd.org/changeset/base/259167

Log:
  Added a timeout to this scenario and a failure notification.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/sendfile4.sh

Modified: user/pho/stress2/misc/sendfile4.sh
==============================================================================
--- user/pho/stress2/misc/sendfile4.sh	Tue Dec 10 11:45:39 2013	(r259166)
+++ user/pho/stress2/misc/sendfile4.sh	Tue Dec 10 11:47:38 2013	(r259167)
@@ -36,11 +36,11 @@
 here=`pwd`
 cd /tmp
 sed '1,/^EOF/d' < $here/$0 > sendfile4.c
-cc -o sendfile4 -Wall -Wextra -O2 sendfile4.c
+cc -o sendfile4 -Wall -Wextra -O2 sendfile4.c || exit
 rm -f sendfile4.c
 cd $here
 
-/tmp/sendfile4 /usr/libexec/cc1
+/tmp/sendfile4 /usr/libexec/cc1 || echo FAIL
 
 rm -f /tmp/sendfile4
 exit
@@ -53,9 +53,15 @@ EOF
 #include <sys/wait.h>
 #include <err.h>
 #include <errno.h>
+#include <signal.h>
 #include <stdlib.h>
 #include <unistd.h>
 
+static void
+handler(int i __unused) {
+	_exit(1);
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -82,6 +88,8 @@ main(int argc, char *argv[])
 	if (error == -1)
 		err(1, "socketpair");
 
+	signal(SIGALRM, handler);
+	alarm(120);
 	child = fork();
 	if (child == -1)
 		err(1, "fork");


More information about the svn-src-user mailing list