diff options
| author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-01-20 00:12:21 +0000 |
|---|---|---|
| committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-01-20 00:12:21 +0000 |
| commit | d9609839bd02e67d66acc2e21bfeb35d5784939e (patch) | |
| tree | 3ab81ee61bec6aaf2a4d8ed99e70a0fb1fcc188e | |
| parent | 8990f0e2f83db4db18fa9cf5044ab2b357202d0c (diff) | |
| download | busybox-w32-d9609839bd02e67d66acc2e21bfeb35d5784939e.tar.gz busybox-w32-d9609839bd02e67d66acc2e21bfeb35d5784939e.tar.bz2 busybox-w32-d9609839bd02e67d66acc2e21bfeb35d5784939e.zip | |
Close unused pipe handle before fork (for tar -z).
git-svn-id: svn://busybox.net/trunk/busybox@1618 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -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 844559580..49e99a1a5 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
| @@ -169,13 +169,16 @@ extern int tar_unzip_init(int tarFd) | |||
| 169 | 169 | ||
| 170 | if (child_pid==0) { | 170 | if (child_pid==0) { |
| 171 | /* child process */ | 171 | /* child process */ |
| 172 | close(unzip_pipe[0]); | ||
| 172 | gunzip_init(); | 173 | gunzip_init(); |
| 173 | unzip(tarFd, unzip_pipe[1]); | 174 | unzip(tarFd, unzip_pipe[1]); |
| 174 | exit(EXIT_SUCCESS); | 175 | exit(EXIT_SUCCESS); |
| 175 | } | 176 | } |
| 176 | else | 177 | else { |
| 177 | /* return fd of uncompressed data to parent process */ | 178 | /* return fd of uncompressed data to parent process */ |
| 179 | close(unzip_pipe[1]); | ||
| 178 | return(unzip_pipe[0]); | 180 | return(unzip_pipe[0]); |
| 181 | } | ||
| 179 | } | 182 | } |
| 180 | #endif | 183 | #endif |
| 181 | 184 | ||
| @@ -169,13 +169,16 @@ extern int tar_unzip_init(int tarFd) | |||
| 169 | 169 | ||
| 170 | if (child_pid==0) { | 170 | if (child_pid==0) { |
| 171 | /* child process */ | 171 | /* child process */ |
| 172 | close(unzip_pipe[0]); | ||
| 172 | gunzip_init(); | 173 | gunzip_init(); |
| 173 | unzip(tarFd, unzip_pipe[1]); | 174 | unzip(tarFd, unzip_pipe[1]); |
| 174 | exit(EXIT_SUCCESS); | 175 | exit(EXIT_SUCCESS); |
| 175 | } | 176 | } |
| 176 | else | 177 | else { |
| 177 | /* return fd of uncompressed data to parent process */ | 178 | /* return fd of uncompressed data to parent process */ |
| 179 | close(unzip_pipe[1]); | ||
| 178 | return(unzip_pipe[0]); | 180 | return(unzip_pipe[0]); |
| 181 | } | ||
| 179 | } | 182 | } |
| 180 | #endif | 183 | #endif |
| 181 | 184 | ||
