Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2018 16:40:22 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335001 - head/usr.bin/diff
Message-ID:  <201806121640.w5CGeMmH094510@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806121640.w5CGeMmH094510>