From owner-svn-src-head@freebsd.org Tue Jun 12 16:40:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C46B1004AC9; Tue, 12 Jun 2018 16:40:23 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE2D66D01C; Tue, 12 Jun 2018 16:40:22 +0000 (UTC) (envelope-from bapt@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A09F1532C; Tue, 12 Jun 2018 16:40:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5CGeMXg094511; Tue, 12 Jun 2018 16:40:22 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5CGeMmH094510; Tue, 12 Jun 2018 16:40:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201806121640.w5CGeMmH094510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 12 Jun 2018 16:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335001 - head/usr.bin/diff X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.bin/diff X-SVN-Commit-Revision: 335001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 16:40:23 -0000 Author: bapt Date: Tue Jun 12 16:40:22 2018 New Revision: 335001 URL: https://svnweb.freebsd.org/changeset/base/335001 Log: Correctly test return value of pipe(2) CID: 1393351 Modified: head/usr.bin/diff/pr.c Modified: head/usr.bin/diff/pr.c ============================================================================== --- head/usr.bin/diff/pr.c Tue Jun 12 16:19:27 2018 (r335000) +++ head/usr.bin/diff/pr.c Tue Jun 12 16:40:22 2018 (r335001) @@ -58,7 +58,8 @@ start_pr(char *file1, char *file2) signal(SIGPIPE, SIG_IGN); fflush(stdout); rewind(stdout); - pipe(pfd); + if (pipe(pfd) == -1) + err(2, "pipe"); switch ((pid = pdfork(&pr_pd, PD_CLOEXEC))) { case -1: status |= 2;