diff options
author | Glenn L McGrath | 2001-01-20 00:12:21 +0000 |
---|---|---|
committer | Glenn L McGrath | 2001-01-20 00:12:21 +0000 |
commit | 1d269432b16b77e78544cf2b7aae04f0e4b8c06c (patch) | |
tree | 3ab81ee61bec6aaf2a4d8ed99e70a0fb1fcc188e | |
parent | 8392acd8fc7e09572324c5567680b624eda4bfa8 (diff) | |
download | busybox-1d269432b16b77e78544cf2b7aae04f0e4b8c06c.zip busybox-1d269432b16b77e78544cf2b7aae04f0e4b8c06c.tar.gz |
Close unused pipe handle before fork (for tar -z).
-rw-r--r-- | archival/tar.c | 5 | ||||
-rw-r--r-- | tar.c | 5 |
2 files changed, 8 insertions, 2 deletions
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 @@ 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 @@ -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 |