Close unused pipe handle before fork (for tar -z).

This commit is contained in:
Glenn L McGrath committed 2001-01-20 00:12:21 +00:00
1 parent 8392acd8fc
commit 1d269432b1
2 files changed
+8 -2

No files matched your search

+4 -1
View File
@@ -169,13 +169,16 @@ 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
+4 -1
View File
@@ -169,13 +169,16 @@ 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