From owner-svn-src-user@freebsd.org  Mon Nov 30 08:30:46 2015
Return-Path: <owner-svn-src-user@freebsd.org>
Delivered-To: svn-src-user@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FF5A3A6C1
 for <svn-src-user@mailman.ysv.freebsd.org>;
 Mon, 30 Nov 2015 08:30:46 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9555214EB;
 Mon, 30 Nov 2015 08:30:46 +0000 (UTC) (envelope-from pho@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU8Ujwl034126;
 Mon, 30 Nov 2015 08:30:45 GMT (envelope-from pho@FreeBSD.org)
Received: (from pho@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU8Ujcx034125;
 Mon, 30 Nov 2015 08:30:45 GMT (envelope-from pho@FreeBSD.org)
Message-Id: <201511300830.tAU8Ujcx034125@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org
 using -f
From: Peter Holm <pho@FreeBSD.org>
Date: Mon, 30 Nov 2015 08:30:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-user@freebsd.org
Subject: svn commit: r291473 - user/pho/stress2/misc
X-SVN-Group: user
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-user@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: "SVN commit messages for the experimental &quot; user&quot;
 src tree" <svn-src-user.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user/>
List-Post: <mailto:svn-src-user@freebsd.org>
List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-user>,
 <mailto:svn-src-user-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Nov 2015 08:30:46 -0000

Author: pho
Date: Mon Nov 30 08:30:45 2015
New Revision: 291473
URL: https://svnweb.freebsd.org/changeset/base/291473

Log:
  Limit run time.
  
  Sponsored by:	EMC / Isilon storage division

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

Modified: user/pho/stress2/misc/alternativeFlushPath.sh
==============================================================================
--- user/pho/stress2/misc/alternativeFlushPath.sh	Mon Nov 30 08:02:52 2015	(r291472)
+++ user/pho/stress2/misc/alternativeFlushPath.sh	Mon Nov 30 08:30:45 2015	(r291473)
@@ -48,7 +48,8 @@ rm -rf $dir
 mkdir -p $dir
 cd $dir
 sed '1,/^EOF/d' < $odir/$0 > $dir/alternativeFlushPath.c
-mycc -o /tmp/alternativeFlushPath -Wall -Wextra alternativeFlushPath.c
+mycc -o /tmp/alternativeFlushPath -Wall -Wextra alternativeFlushPath.c ||
+    exit 1
 rm -f alternativeFlushPath.c
 
 for j in `jot 10`; do
@@ -72,6 +73,8 @@ EOF
 #include <sys/resource.h>
 #include <err.h>
 
+#define MAXNOFILE 500000	/* To limit runtime */
+
 static volatile sig_atomic_t more;
 
 static void
@@ -90,6 +93,8 @@ test(void)
 
         if (getrlimit(RLIMIT_NOFILE, &rlp) == -1)
                 err(1, "getrlimit(RLIMIT_NOFILE)");
+	if (rlp.rlim_cur > MAXNOFILE)
+		rlp.rlim_cur = MAXNOFILE;
 	rlp.rlim_cur /= 10;
         mypid = getpid();
         fd = malloc(rlp.rlim_cur * sizeof(int));