From ee209e5ce8c4a31ff4afd12dc7d3b37c9a388251 Mon Sep 17 00:00:00 2001 From: jilles Date: Sun, 15 May 2011 17:00:43 +0000 Subject: sh: Avoid close(-1) when evaluating a multi-command pipeline. Valgrind complains about this. --- bin/sh/eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/sh/eval.c b/bin/sh/eval.c index b0ee28e..b19c24f 100644 --- a/bin/sh/eval.c +++ b/bin/sh/eval.c @@ -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) { -- cgit v1.1