Don't close file descriptors when we are duplicating them.
This commit is contained in:
parent
f4dd6e3d1a
commit
c616e53ca2
3
hush.c
3
hush.c
@ -1018,7 +1018,8 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
|
||||
close(openfd);
|
||||
} else {
|
||||
dup2(openfd, redir->fd);
|
||||
close(openfd);
|
||||
if (redir->dup == -1)
|
||||
close (openfd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1018,7 +1018,8 @@ static int setup_redirects(struct child_prog *prog, int squirrel[])
|
||||
close(openfd);
|
||||
} else {
|
||||
dup2(openfd, redir->fd);
|
||||
close(openfd);
|
||||
if (redir->dup == -1)
|
||||
close (openfd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user