From 8f5c93f79f2c4243f8338ef8245d2bd0d4882617 Mon Sep 17 00:00:00 2001 From: Alfred Perlstein Date: Mon, 24 Dec 2001 22:27:04 +0000 Subject: [PATCH] backout rev 1.14, it's breaking things. --- bin/sh/redir.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/sh/redir.c b/bin/sh/redir.c index 8c05da91743d..ee893f40bef2 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -145,8 +145,11 @@ redirect(redir, flags) } if (!try) { sv->renamed[fd] = i; + close(fd); } INTON; + } else { + close(fd); } if (fd == 0) fd0_redirected++; @@ -183,7 +186,6 @@ openredirect(redir, memory) error("cannot open %s: %s", fname, errmsg(errno, E_OPEN)); movefd: if (f != fd) { - close(fd); copyfd(f, fd); close(f); }