On Mon, 2 Jun 2008, Denys Vlasenko wrote:

> On Sunday 01 June 2008 21:18, Cristian Ionescu-Idbohrn wrote:
>
>
>  int printf_main(int argc ATTRIBUTE_UNUSED, char **argv)
>  {
>         char *format;
>         char **argv2;
>
> +       /* We must check that stdout is not closed.
> +        * The reason for this is highly non-obvious.
> +        * echo_main is used from shell. Shell must correctly handle "echo 
> foo"
> +        * if stdout is closed. With stdio, output gets shoveled into
> +        * stdout buffer, and even fflush cannot clear it out. It seems that
> +        * even if libc receives EBADF on write attempts, it feels determined
> +        * to output data no matter what. So it will try later,
> +        * and possibly will clobber future output. Not good. */
> +       if (dup2(1, 1) != 1)
> +               return -1;
>
> copy-paste error in comments.

Yes.  Sorry about that.

> Also with attached .config:
>
> shell/lib.a(ash.o):(.rodata.builtintab+0xc4): undefined reference to 
> `printf_main'
> collect2: ld returned 1 exit status
> make: *** [busybox_unstripped] Error 1
>
> I fixed it up and applied to svn. Thanks.

Thank you.

> P.S. If it's not too difficult, please send patches which are applyable
> with patch -p1 (i.e. kernel-style patches).
> Currently you are sending -p0 patches.

Not difficult at all :)  I'll try to remember that.


Cheers,

-- 
Cristian
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox

Reply via email to