mirror of
https://github.com/sheumann/hush.git
synced 2025-01-04 22:34:37 +00:00
fix #>&- syntax for closing fds
This commit is contained in:
parent
9052600feb
commit
dc4178050a
@ -2064,7 +2064,8 @@ static int setup_redirects(struct command *prog, int squirrel[])
|
|||||||
squirrel[redir->fd] = dup(redir->fd);
|
squirrel[redir->fd] = dup(redir->fd);
|
||||||
}
|
}
|
||||||
if (openfd == -3) {
|
if (openfd == -3) {
|
||||||
//close(openfd); // close(-3) ??!
|
/* "-" means "close me" and we use -3 for that */
|
||||||
|
close(redir->fd);
|
||||||
} else {
|
} else {
|
||||||
dup2(openfd, redir->fd);
|
dup2(openfd, redir->fd);
|
||||||
if (redir->dup == -1)
|
if (redir->dup == -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user