mirror of
https://github.com/sheumann/hush.git
synced 2024-11-09 02:09:01 +00:00
Close unused pipe handle before fork (for tar -z).
This commit is contained in:
parent
8392acd8fc
commit
1d269432b1
@ -169,14 +169,17 @@ extern int tar_unzip_init(int tarFd)
|
||||
|
||||
if (child_pid==0) {
|
||||
/* child process */
|
||||
close(unzip_pipe[0]);
|
||||
gunzip_init();
|
||||
unzip(tarFd, unzip_pipe[1]);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
else
|
||||
else {
|
||||
/* return fd of uncompressed data to parent process */
|
||||
close(unzip_pipe[1]);
|
||||
return(unzip_pipe[0]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int tar_main(int argc, char **argv)
|
||||
|
5
tar.c
5
tar.c
@ -169,14 +169,17 @@ extern int tar_unzip_init(int tarFd)
|
||||
|
||||
if (child_pid==0) {
|
||||
/* child process */
|
||||
close(unzip_pipe[0]);
|
||||
gunzip_init();
|
||||
unzip(tarFd, unzip_pipe[1]);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
else
|
||||
else {
|
||||
/* return fd of uncompressed data to parent process */
|
||||
close(unzip_pipe[1]);
|
||||
return(unzip_pipe[0]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
extern int tar_main(int argc, char **argv)
|
||||
|
Loading…
Reference in New Issue
Block a user