summaryrefslogtreecommitdiffstats
path: root/bin/sh
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-12-24 22:27:04 +0000
committeralfred <alfred@FreeBSD.org>2001-12-24 22:27:04 +0000
commit39b93da10a3731b4cbc361775f3af082bfd9036d (patch)
treef7885d1b505ab88dc9d325bd4cdcc57ae3625cb9 /bin/sh
parent854cfdfa97272554f2e0d47a5b3aae58a7d08da2 (diff)
downloadFreeBSD-src-39b93da10a3731b4cbc361775f3af082bfd9036d.zip
FreeBSD-src-39b93da10a3731b4cbc361775f3af082bfd9036d.tar.gz
backout rev 1.14, it's breaking things.
Diffstat (limited to 'bin/sh')
-rw-r--r--bin/sh/redir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/sh/redir.c b/bin/sh/redir.c
index 8c05da9..ee893f4 100644
--- a/bin/sh/redir.c
+++ b/bin/sh/redir.c
@@ -145,8 +145,11 @@ again:
}
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);
}
OpenPOWER on IntegriCloud