sh: Avoid close(-1) when evaluating a multi-command pipeline.

Valgrind complains about this.
This commit is contained in:
jilles 2011-05-15 17:00:43 +00:00
parent 43b24a4ea4
commit ee209e5ce8

View File

@ -552,7 +552,8 @@ evalpipe(union node *n)
if (prevfd >= 0)
close(prevfd);
prevfd = pip[0];
close(pip[1]);
if (pip[1] != -1)
close(pip[1]);
}
INTON;
if (n->npipe.backgnd == 0) {