perror() changes the orientation of stderr to byte-oriented mode if stderr is not oriented yet.

Takashi Yano takashi.yano@nifty.ne.jp
Thu Jun 28 11:14:00 GMT 2018


Hi Corinna,

On Wed, 27 Jun 2018 14:55:03 +0200
Corinna Vinschen wrote:
> again, please send patches related to newlib to the newlib mailing list.
> Newlib patches affect more targets than just Cygwin.  I redirected this
> mail to the newlib list and attached your original attachments.  Thank
> you.

Next time I will. Sorry for my inadequate understanding about newlib.

> I'm not sure exactly.  It may be nice to keep the writes buffered
> if the original stderr stream is buffered as well.
> 
> What about duplicating the non-_FVWRITE_IN_STREAMIO part of _fputs_r,
> just without calling ORIENT?

Thank you for your suggestion.

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.

Could you please have a look?

-- 
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: 2374 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20180628/dbc979d7/attachment.obj>


More information about the Newlib mailing list