_alpm_run_chroot: only close working directory if it was opened
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
2f0ca00e55
commit
804688ab6a
|
@ -542,7 +542,9 @@ int _alpm_run_chroot(alpm_handle_t *handle, const char *cmd, char *const argv[])
|
|||
while(dup2(pipefd[1], 2) == -1 && errno == EINTR);
|
||||
close(pipefd[0]);
|
||||
close(pipefd[1]);
|
||||
if(cwdfd >= 0) {
|
||||
close(cwdfd);
|
||||
}
|
||||
|
||||
/* use fprintf instead of _alpm_log to send output through the parent */
|
||||
if(chroot(handle->root) != 0) {
|
||||
|
|
Loading…
Reference in New Issue