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

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAls5/lYACgkQ9TYGna5E
T6BY7w//QGagRwz2E/IQkckRT2wxaRqVa4cpsx5Bry6T7Ih4uo7iuZO3hGtgbR2c
s9gJXsHRVdFNQ3ihICNWi7yLg2y1BUTxOfPMZuMvK3uoVZJ/0rdlxCbhs+kBmesG
gU05QX5gEjSofRIWJmizA8VWuQZbOLX5xd4JPPAkK8kXGOU9jY7x9TPaE672UI3P
aF+QqdLT7m7qo9+EcxpGJcTBJ8/h8W7ZfZQ/5udp8Vm8qGemu8I7gGTOehDEVuGq
Z87eypAzTBg4gaMp7MXGOSppm09NKzDOPIV8cEJsfEtpy+9TgVnMCxwuGmwjKKef
a6dufl6HLNEtlxykToml/oBcwuIyDj5TVXzR/5hDGdqQrjggy8sg0PohyRvMNArX
DhAhLkLfaX6e51PQLVZJ//Zf1dW0gDoAYKewvPWkGNM+8Dcvv7ZBmJag+ZuBu+Uf
f/U5BVNInEIbd4HeUa34UE6UOjZ0rnBAaaJZZU4+DRAve164PPJSDW8NfjmXGEy0
560AJ6tSxe2ltH9rWmuPjxO9cMzi+F2Q7bBeQLvrosQ0L8B4n4O80PJitQi6jEsJ
ZWroN+BEU/JkRJVLY0Cn1rFaI71P3DN7f3VCJLHDk2gCE3igi+d3OkEX5T0AUTK7
sXp5XEwsOuoMsqfqjdz3EoY1UlLJb891h7K4Quxce4M6UhcX50M=
=RwHV
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.