This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

[Bug stdio/20677] perror() changes orientation of stream when it is redirected


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.

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