svn commit: trunk/busybox/archival

Rob Landley rob at landley.net
Mon Sep 11 20:45:26 UTC 2006


On Monday 11 September 2006 4:10 am, Bernhard Fischer wrote:
> >-	memset(&header, 0, size);
> >+	bzero(&header, size);
> 
> Please do NOT re-introduce deprecated functions!
> bzero is deprecated and flagged as LEGACY in POSIX.1-2001; See also
> "issue 6" in
> http://www.opengroup.org/onlinepubs/009695399/functions/bzero.html

I don't care.  It's smaller (one less argument), everything currently supports 
it, and worst case scenario we can add it to platform.c.  Any function "may 
be withdrawn in a future version".  That's not my problem.  It's in SUSv3, 
I'm using it.

> >-	/* Pad the header up to the tar block size */
> >-	size = pad_block_write(tbInfo->tarFd, size);
> >+	xwrite(tbInfo->tarFd, &header, sizeof(struct TarHeader));
> 
> You're certainly more familiar with tar, but is xwrite() a good idea
> here? Do we now create foobared .tar's ?

Half the time I tar output to a pipe, and really don't know what tar's 
behavior is when it's writing to a partition of limited size.  Let's see what 
the tar in Ubuntu does...

mount -t tmpfs -osize=100k thingy thingy
cd thingy
tar cvjf linux.tbz ../linux-2.6.17.11
...

And when it dies...

> ../linux-2.6.17.11/Documentation/aoe/status.sh
> ../linux-2.6.17.11/Documentation/aoe/todo.txt
> ../linux-2.6.17.11/Documentation/aoe/udev-install.sh
> ../linux-2.6.17.11/Documentation/aoe/udev.txt
> ../linux-2.6.17.11/Documentation/applying-patches.txt
>
> bzip2: I/O or other error, bailing out.  Possible reason follows.
> bzip2: No space left on device
>         Input file = (stdin), output file = (stdout)
> root at driftwood:/home/landley/timesys# ls
> linux.tbz
> root at driftwood:/home/landley/timesys# ls -l
> total 100
> -rw-r--r-- 1 root root 94208 2006-09-11 16:41 linux.tbz

Yes, gnu tar creates a truncated archive.  I don't see the downside of us 
doing so too.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list