[BusyBox] Bug in tar

Glenn McGrath bug1 at optushome.com.au
Sat Jan 20 00:19:37 UTC 2001


Francois-R Boyer wrote:
> 
> Pipes are not handled correctly when using 'tar -zx...'.  Each process
> should close the file handle that is not used, like this:
>     if (child_pid==0) {
>         /* child process */
>         close(unzip_pipe[0]);
>         gunzip_init();
>         unzip(tarFd, unzip_pipe[1]);
>         exit(EXIT_SUCCESS);
>     }
>     else
>     {
>         close(unzip_pipe[1]);
>         /* return fd of uncompressed data to parent process */
>         return(unzip_pipe[0]);
>     }
> That way, read and write on the pipe will correctly return with an error if
> the other end of the pipe is closed, and the "signal(SIGCHLD, child_died);"
> patch is not needed.
> 

Hmm, im not so conviced about not needing signals(that was Eriks idea)
anyone else care to comment ?

Glenn





More information about the busybox mailing list