From owner-svn-src-user@FreeBSD.ORG Wed Feb 4 13:56:39 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8A8617B; Wed, 4 Feb 2015 13:56:39 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAE099BB; Wed, 4 Feb 2015 13:56:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t14DudeR051691; Wed, 4 Feb 2015 13:56:39 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t14DudB4051690; Wed, 4 Feb 2015 13:56:39 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201502041356.t14DudB4051690@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 4 Feb 2015 13:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r278208 - 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.18-1 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: Wed, 04 Feb 2015 13:56:40 -0000 Author: pho Date: Wed Feb 4 13:56:38 2015 New Revision: 278208 URL: https://svnweb.freebsd.org/changeset/base/278208 Log: Sort include files, fix trailing whitespace and add missing zero of inetaddr. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/sendfile3.sh Modified: user/pho/stress2/misc/sendfile3.sh ============================================================================== --- user/pho/stress2/misc/sendfile3.sh Wed Feb 4 13:50:50 2015 (r278207) +++ user/pho/stress2/misc/sendfile3.sh Wed Feb 4 13:56:38 2015 (r278208) @@ -31,8 +31,7 @@ # Test scenario for sendfile deadlock (processes stuck in sfbufa) # Variation of sendfile.sh - -. ../default.cfg +# kern.ipc.nsfbufs should be low for this test odir=`pwd` @@ -47,7 +46,6 @@ in=/tmp/inputFile out=/tmp/outputFile parallel=20 -[ `sysctl kern.ipc.nsfbufs | awk '{print $NF}'` -gt 512 ] && echo "kern.ipc.nsfbufs should be low for this test" for i in 50m 100m; do rm -f $in dd if=/dev/random of=$in bs=$i count=1 2>&1 | \ @@ -66,18 +64,20 @@ done rm -f $in /tmp/sendfile3 exit EOF +#include +#include +#include +#include + +#include + #include #include #include -#include #include #include #include #include -#include -#include -#include -#include #include int port; @@ -149,7 +149,7 @@ writer(void) { off_t off = 0; on = 1; - for (i = 1; i < 5; i++) { + for (i = 0; i < 5; i++) { if ((tcpsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) err(1, "socket(), %s:%d", __FILE__, __LINE__); @@ -157,6 +157,7 @@ writer(void) { SOL_SOCKET, SO_REUSEADDR, (char *)&on, sizeof(on)) < 0) err(1, "setsockopt(), %s:%d", __FILE__, __LINE__); + bzero((char *) &inetaddr, sizeof(inetaddr)); hostent = gethostbyname ("localhost"); memcpy (&inetaddr.sin_addr.s_addr, hostent->h_addr, sizeof (struct in_addr)); @@ -184,8 +185,6 @@ writer(void) { if (sendfile(fd, tcpsock, 0, statb.st_size, NULL, &off, 0) == -1) err(1, "sendfile"); - - return; } int @@ -209,7 +208,7 @@ main(int argc, char **argv) reader(); kill(pid, SIGINT); waitpid(pid, NULL, 0); - } else + } else err(1, "fork(), %s:%d", __FILE__, __LINE__); return (0);