diff options
author | jilles <jilles@FreeBSD.org> | 2013-06-28 21:47:08 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-06-28 21:47:08 +0000 |
commit | 836c13641c73319eef10a3a90e025e071f1a5c44 (patch) | |
tree | 4528fdaf16d13f5457602fa275c21cc78f70472a /bin | |
parent | 26a7b2145683f1541b5d69ff0f4bf4c68574c6e8 (diff) | |
download | FreeBSD-src-836c13641c73319eef10a3a90e025e071f1a5c44.zip FreeBSD-src-836c13641c73319eef10a3a90e025e071f1a5c44.tar.gz |
sh: Do not close(-1) if pipe() fails.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c index d3708b3..1a6d5ed 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -589,7 +589,8 @@ evalpipe(union node *n) pip[1] = -1; if (lp->next) { if (pipe(pip) < 0) { - close(prevfd); + if (prevfd >= 0) + close(prevfd); error("Pipe call failed: %s", strerror(errno)); } } |