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

Peter Holm pho at FreeBSD.org
Wed Dec 9 13:45:52 UTC 2015


Author: pho
Date: Wed Dec  9 13:45:51 2015
New Revision: 292018
URL: https://svnweb.freebsd.org/changeset/base/292018

Log:
  Added timeout to test.
  
  Sponsored by:	EMC / Isilon storage division

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

Modified: user/pho/stress2/misc/fcntl.sh
==============================================================================
--- user/pho/stress2/misc/fcntl.sh	Wed Dec  9 12:25:03 2015	(r292017)
+++ user/pho/stress2/misc/fcntl.sh	Wed Dec  9 13:45:51 2015	(r292018)
@@ -38,8 +38,7 @@ sed '1,/^EOF/d' < $here/$0 > fcntl.c
 mycc -o fcntl -Wall -Wextra -O0 -g fcntl.c || exit 1
 rm -f fcntl.c
 
-/tmp/fcntl
-status=$?
+/tmp/fcntl || { status=$?; echo FAIL; }
 
 rm -f /tmp/fcntl
 exit $status
@@ -63,6 +62,13 @@ const char name[] = "work";
 int fd;
 
 static void
+ahandler(int s __unused)
+{
+	unlink(name);
+	_exit(1);
+}
+
+static void
 handler(int s __unused)
 {
 	completed++;
@@ -176,6 +182,8 @@ main(void)
 	off_t len;
 
 	signal(SIGHUP, handler);
+	signal(SIGALRM, ahandler);
+	alarm(300);
 	if ((fd = open(name, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1)
 		err(1, "open(%s)", name);
 	len = N * sizeof(val);


More information about the svn-src-user mailing list