diff options
author | tjr <tjr@FreeBSD.org> | 2002-07-09 08:55:46 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-07-09 08:55:46 +0000 |
commit | df20e19b27e4883867e7cebb064c311332f30050 (patch) | |
tree | f2ecf6d269db0a5e879f67bc2871dac56fbd1e46 /bin | |
parent | 53a32e18d8db5ea5ed5bc3c17568cd91692edbe0 (diff) | |
download | FreeBSD-src-df20e19b27e4883867e7cebb064c311332f30050.zip FreeBSD-src-df20e19b27e4883867e7cebb064c311332f30050.tar.gz |
Close file descriptors when [n]>&- and [n]<&- redirections are used.
This was broken by rev. 1.16.
PR: 40334
MFC after: 1 week
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/redir.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/redir.c b/bin/sh/redir.c index ec9e5cc..d1d46eb 100644 --- a/bin/sh/redir.c +++ b/bin/sh/redir.c @@ -247,7 +247,8 @@ movefd: close(fd); copyfd(redir->ndup.dupfd, fd); } - } + } else + close(fd); break; case NHERE: case NXHERE: |