[PATCH] tar --to-command
Denys Vlasenko
vda.linux at googlemail.com
Sat Jun 26 21:09:44 UTC 2010
On Sunday 27 June 2010 00:35, Ladislav Michl wrote:
> On Sat, Jun 26, 2010 at 06:24:06PM +0200, Denys Vlasenko wrote:
> > On Friday 25 June 2010 15:11, Ladislav Michl wrote:
> > > GNU tar handles this special way, ignoring write errors when piping to command.
> >
> > Thanks, fixed:
> >
> > http://git.busybox.net/busybox/commit/?id=d0a8a0d31243f2ac798531ced2cca45ddf1fea42
>
> Seek optimization was dropped, but that's only minor performance issue, which
> is indeed not worth doing. However sometning like this is needed to work with
> copybuf <= 4kB ...
>
> diff --git a/libbb/copyfd.c b/libbb/copyfd.c
> index 2538d49..0a124bb 100644
> --- a/libbb/copyfd.c
> +++ b/libbb/copyfd.c
> @@ -17,19 +17,19 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
> {
> int status = -1;
> off_t total = 0;
> + bool continue_on_write_error = 0;
> #if CONFIG_FEATURE_COPYBUF_KB <= 4
> char buffer[CONFIG_FEATURE_COPYBUF_KB * 1024];
> enum { buffer_size = sizeof(buffer) };
> #else
> char *buffer;
> int buffer_size;
> - bool continue_on_write_error = 0;
> -
> +#endif
> if (size < 0) {
> size = -size;
> continue_on_write_error = 1;
> }
> -
> +#if CONFIG_FEATURE_COPYBUF_KB > 4
> if (size > 0 && size <= 4 * 1024)
> goto use_small_buf;
> /* We want page-aligned buffer, just in case kernel is clever
Applied, thanks!
--
vda
More information about the busybox
mailing list