perror() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.
Takashi Yano
takashi.yano@nifty.ne.jp
Fri Jun 29 12:38:00 GMT 2018
I am not in a position to comment whether POSIX is wrong or not, so
nothing about that.
On Thu, 28 Jun 2018 20:31:57 +0200
Corinna Vinschen wrote:
> > I tried this but it failed because __sputc_r() called from _fputs_r also
> > sets orientation. So I have borrowed the codes from __swbuf_r() in wbuf.c
> > so that the strings are pushed directly into the buffer.
>
> I did. Thanks for implementing this, but... uhm... I'm not really
> thrilled. So much extra code for such a simple thing as perror...?
>
> On second thought I wonder if we shouldn't just go the FreeBSD route.
Maybe. But I have another possibility. What about this one?
By the way, I have noticed that psignal() and psiginfo() also have the
same problem. psignal() belongs to newlib, so the same strategy can
be applied. However, what can we do for psiginfo()? Only the FreeBSD
route may be the answer...
--
Takashi Yano <takashi.yano@nifty.ne.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-a-bug-of-perror-which-changes-the-orientation-of.patch
Type: application/octet-stream
Size: 2147 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20180629/168bd056/attachment.obj>
More information about the Newlib
mailing list