This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Jun 29 21:34, Takashi Yano wrote:
> I am not in a position to comment whether POSIX is wrong or not, so
> nothing about that.

Well, either we all are in this position or nobody of us ;)

> 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?

Not sure if I'm missing something, but doesn't that mean the perror
output won't use text mode even if it's requested?

> 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...

I guess the simplest solution is to use the FreeBSD/OpenBSD method
all the time.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]