sh: Avoid close(-1) when evaluating a multi-command pipeline.
Valgrind complains about this.
This commit is contained in:
parent
6c7e04f0f3
commit
e64a11e9eb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221970
@ -552,7 +552,8 @@ evalpipe(union node *n)
|
|||||||
if (prevfd >= 0)
|
if (prevfd >= 0)
|
||||||
close(prevfd);
|
close(prevfd);
|
||||||
prevfd = pip[0];
|
prevfd = pip[0];
|
||||||
close(pip[1]);
|
if (pip[1] != -1)
|
||||||
|
close(pip[1]);
|
||||||
}
|
}
|
||||||
INTON;
|
INTON;
|
||||||
if (n->npipe.backgnd == 0) {
|
if (n->npipe.backgnd == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user