[BusyBox] Bug in tar

Glenn McGrath bug1 at optushome.com.au
Sat Jan 20 06:03:31 UTC 2001


Francois-R Boyer wrote:
> 
> If we don't use the "if(errno == EPIPE) return;" we can make tar so that it does not break
> the pipe.
> Remove all close(tarFd) from readTarFile, and the code to wait for the child would become:
>         if (unzipFlag == TRUE)
>         {
>             char buf[4096];
>             while(waitpid(child_pid, NULL, WNOHANG) == 0) read(tarFd,buf,sizeof(buf));
>         }
> 
> If we don't read what comes from the pipe, the child will block when the pipe buffer is
> full.  I agree that ignoring EPIPE was not the best solution, but it was better than leaving
> it the way it was.  This new solution is better, and no changes are made to gunzip.
> 
>     François
> 

How about something like the attached patch, it makes sense to take the
3 close(tarFd) statements out of readTarFile and put one close(tarFd)
after where it was called from.

I got a bit lost with your while loop as to how it would apply to tar.c,
but i see what you are trying to do i think.

How are you causing tar -z to fail (so i can test it myself) ?


Glenn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.tar
Type: application/x-tar
Size: 1505 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20010120/f82c5e44/attachment.tar 


More information about the busybox mailing list