From owner-svn-src-user@freebsd.org Tue Oct 3 07:01:26 2017 Return-Path: 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 0A187E331C1 for ; Tue, 3 Oct 2017 07:01:26 +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 CC5D967957; Tue, 3 Oct 2017 07:01:25 +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 v9371Omu086536; Tue, 3 Oct 2017 07:01:24 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9371OrC086535; Tue, 3 Oct 2017 07:01:24 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201710030701.v9371OrC086535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Tue, 3 Oct 2017 07:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r324231 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 324231 X-SVN-Commit-Repository: base 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.23 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: Tue, 03 Oct 2017 07:01:26 -0000 Author: pho Date: Tue Oct 3 07:01:24 2017 New Revision: 324231 URL: https://svnweb.freebsd.org/changeset/base/324231 Log: Return error status. Style fix. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/sendfile11.sh Modified: user/pho/stress2/misc/sendfile11.sh ============================================================================== --- user/pho/stress2/misc/sendfile11.sh Tue Oct 3 07:00:26 2017 (r324230) +++ user/pho/stress2/misc/sendfile11.sh Tue Oct 3 07:01:24 2017 (r324231) @@ -129,10 +129,11 @@ reader(void) { t = 0; if ((buf = malloc(BUFSIZE)) == NULL) - err(1, "malloc(%d), %s:%d", BUFSIZE, __FILE__, __LINE__); + err(1, "malloc(%d), %s:%d", BUFSIZE, __FILE__, __LINE__); - if ((fd = open(outputFile, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) - err(1, "open(%s)", outputFile); + if ((fd = open(outputFile, O_RDWR | O_CREAT | O_TRUNC, 0640)) == + -1) + err(1, "open(%s)", outputFile); for (;;) { if ((n = read(msgsock, buf, BUFSIZE)) < 0) @@ -169,7 +170,8 @@ writer(void) { size = getpagesize() -4; if (setsockopt(tcpsock, SOL_SOCKET, SO_SNDBUF, (void *)&size, sizeof(size)) < 0) - err(1, "setsockopt(SO_SNDBUF), %s:%d", __FILE__, __LINE__); + err(1, "setsockopt(SO_SNDBUF), %s:%d", __FILE__, + __LINE__); hostent = gethostbyname ("localhost"); memcpy (&inetaddr.sin_addr.s_addr, hostent->h_addr, @@ -206,11 +208,14 @@ int main(int argc, char **argv) { pid_t pid; + int e, s; if (argc != 4) { - fprintf(stderr, "Usage: %s 0) { reader(); kill(pid, SIGINT); + waitpid(pid, &s, 0); + if (s != 0) + e = 1; } else err(1, "fork(), %s:%d", __FILE__, __LINE__); - return (0); + return (e); }