Close unused pipe handle before fork (for tar -z).
diff --git a/archival/tar.c b/archival/tar.c
index 8445595..49e99a1 100644
--- a/archival/tar.c
+++ b/archival/tar.c
@@ -169,13 +169,16 @@
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
diff --git a/tar.c b/tar.c
index 8445595..49e99a1 100644
--- a/tar.c
+++ b/tar.c
@@ -169,13 +169,16 @@
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