sh: Do not close(-1) if pipe() fails.

This commit is contained in:
jilles 2013-06-28 21:47:08 +00:00
parent 26a7b21456
commit 836c13641c

View File

@ -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));
}
}