[PATCH] dd doesn't return a failure status

Loïc Grenié loic.grenie at gmail.com
Wed Oct 3 09:46:27 UTC 2007


2007/10/3, Kazuo TAKADA <kztakada at sm.sony.co.jp>:
>
> loic.grenie at gmail.com wrote:
> {snip..}
> >
> >    It may be faster to do
> >
> >if ((w = write_and_stats(...)))
> >  goto out_status;
> >
> >  and
> >
> >return w;
> >
> >  because write_and_stats returns 1 on failure. You can even tweak
> >  it to return either EXIT_SUCCESS or EXIT_FAILURE and change the
> >  if to:
> >
> >if ((w = write_and_stats(...)) == EXIT_SUCCESS)
> >  goto out_status;
> >
> >  (which is the same but symbolically different).
>
> I agree with your suggestion basically and I had already tried.
> But, in other lines, the variable 'w' is set with the written size by
> the function 'full_write_or_warn()'.



      Sorry, my bad.

           Loïc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.busybox.net/pipermail/busybox/attachments/20071003/4912b41a/attachment-0002.htm 


More information about the busybox mailing list