diff options
Diffstat (limited to 'bin/sh/eval.c')
-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)); } } |