commit | c616e53ca2d5a46ee5a2b7f272b1b611f01836eb | [log] [tgz] |
---|---|---|
author | Matt Kraai <kraai@debian.org> | Tue Jun 05 16:50:08 2001 +0000 |
committer | Matt Kraai <kraai@debian.org> | Tue Jun 05 16:50:08 2001 +0000 |
tree | aaad20944b2a54e3159a24d4a0be9fe52abe0a7f | |
parent | f4dd6e3d1a49c61c0b0463c6414b734cf95c106f [diff] [blame] |
Don't close file descriptors when we are duplicating them.
diff --git a/hush.c b/hush.c index 372c957..a58da18 100644 --- a/hush.c +++ b/hush.c
@@ -1018,7 +1018,8 @@ close(openfd); } else { dup2(openfd, redir->fd); - close(openfd); + if (redir->dup == -1) + close (openfd); } } }