[BusyBox] Bug in tar
Erik Andersen
andersen at lineo.com
Sat Jan 20 00:38:57 UTC 2001
On Sat Jan 20, 2001 at 11:19:37AM +1100, Glenn McGrath wrote:
> 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 ?
I suppose I am biased, but I am certain there are still cases where the parent can
catch a SIGCHLD. Hmm. I suppose we could do what GNU tar does -- it uses
signal (SIGCHLD, SIG_DFL);
which is sufficient to do the job at hand I suppose.
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list