This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug stdio/20677] perror() changes orientation of stream when it is redirected
- From: "igor.liferenko at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 17 Oct 2016 07:06:33 +0000
- Subject: [Bug stdio/20677] perror() changes orientation of stream when it is redirected
- Auto-submitted: auto-generated
- References: <bug-20677-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20677
--- Comment #5 from Igor Liferenko <igor.liferenko at gmail dot com> ---
Created attachment 9562
--> https://sourceware.org/bugzilla/attachment.cgi?id=9562&action=edit
do not use fdopen on not-oriented streams
Hi all,
Attached is the new patch. I tested this patch and it works good. Specifically,
the output from example 3) now is:
$ ./a.out 2>/dev/null
initial fwide: 0
fwide: 0
In comparison with the previous patch, this patch corrects these things:
1) get rid of "perror_internal" (because it is used only once);
2) fix "write" of newline character;
3) use internal "__write"
4) add verbose comments
What is your opinion about this patch? Especially, I'd like to know what to do
if "__write()" fails and whether "if (_IO_ferror_unlocked(fp))" test may be
safely deleted.
Regards,
Igor
--
You are receiving this mail because:
You are on the CC list for the bug.