From owner-svn-src-user@FreeBSD.ORG Mon Nov 4 11:43:04 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 98400FEE; Mon, 4 Nov 2013 11:43:04 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8435D2FEA; Mon, 4 Nov 2013 11:43:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA4Bh4Ij047506; Mon, 4 Nov 2013 11:43:04 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA4Bh4t8047505; Mon, 4 Nov 2013 11:43:04 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201311041143.rA4Bh4t8047505@svn.freebsd.org> From: Peter Holm Date: Mon, 4 Nov 2013 11:43:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r257627 - 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.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2013 11:43:04 -0000 Author: pho Date: Mon Nov 4 11:43:04 2013 New Revision: 257627 URL: http://svnweb.freebsd.org/changeset/base/257627 Log: Added a timeout and did some cleanup. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/truncate.sh Modified: user/pho/stress2/misc/truncate.sh ============================================================================== --- user/pho/stress2/misc/truncate.sh Mon Nov 4 09:01:52 2013 (r257626) +++ user/pho/stress2/misc/truncate.sh Mon Nov 4 11:43:04 2013 (r257627) @@ -35,7 +35,7 @@ here=`pwd` cd /tmp sed '1,/^EOF/d' < $here/$0 > truncate.c -cc -o truncate -Wall -O2 truncate.c +cc -o truncate -Wall -Wextra -O2 truncate.c || exit 1 rm -f truncate.c [ -d $RUNDIR ] || mkdir -p $RUNDIR cd $RUNDIR @@ -49,6 +49,7 @@ EOF #include #include #include +#include #include #include @@ -58,6 +59,7 @@ char buf[SIZ]; void test(void) { + time_t start; int fd[10], i, j; char name[128]; @@ -68,7 +70,10 @@ test(void) unlink(name); } + start = time(NULL); for (i = 0; i < 100000; i++) { + if (time(NULL) - start > 1200) + break; for (j = 0; j < 10; j++) { if (write(fd[j], buf, 2) != 2) err(1, "write"); @@ -77,10 +82,11 @@ test(void) } } - exit(0); + _exit(0); } + int -main(int argc, char **argv) +main(void) { int i, status;