svn commit: r253390 - user/pho/stress2/lib

Peter Holm pho at FreeBSD.org
Tue Jul 16 11:54:45 UTC 2013


Author: pho
Date: Tue Jul 16 11:54:44 2013
New Revision: 253390
URL: http://svnweb.freebsd.org/changeset/base/253390

Log:
  Check if test scenario terminate before time.
  
  Sponsored by:	EMC / Isilon storage division

Modified:
  user/pho/stress2/lib/main.c

Modified: user/pho/stress2/lib/main.c
==============================================================================
--- user/pho/stress2/lib/main.c	Tue Jul 16 11:54:25 2013	(r253389)
+++ user/pho/stress2/lib/main.c	Tue Jul 16 11:54:44 2013	(r253390)
@@ -165,8 +165,11 @@ run_test(void)
 	if (p < 0)
 		err(1, "fork() in %s:%d", __FILE__, __LINE__);
 	while (done_testing != 1 &&
-			(time(NULL) - start) < op->run_time)
+			(time(NULL) - start) < op->run_time) {
 		sleep(1);
+		if (waitpid(p, &status, WNOHANG) == p)
+			return (status);
+	}
 	if (kill(p, SIGHUP) == -1)
 		warn("kill(%d, SIGHUP), %s:%d", p, __FILE__, __LINE__);
 


More information about the svn-src-user mailing list