sh: Do not close(-1) if pipe() fails.
This commit is contained in:
parent
26a7b21456
commit
836c13641c
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user