From 5a43dca273c2628bb4936deb168acb063da5cee9 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Tue, 12 Jun 2018 16:40:22 +0000 Subject: [PATCH] Correctly test return value of pipe(2) CID: 1393351 --- usr.bin/diff/pr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/diff/pr.c b/usr.bin/diff/pr.c index eaf6e37f9f4..ce8620e1432 100644 --- a/usr.bin/diff/pr.c +++ b/usr.bin/diff/pr.c @@ -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;