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 #3 from Igor Liferenko <igor.liferenko at gmail dot com> ---
Created attachment 9556
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9556&action=edit
Do not use fdopen on not-oriented streams. Just get the fd with fileno() and
then write directly to that fd.

Instead of leaving it completely broken, I suggest the attached patch to fix it
at least partially, until a better solution (without using "fileno") will be
found.

FWIW, the bug was introduced in this commit:

   
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=1fc0e33153186a90140c3d25f5d9b4537890d7cc

Since this commit, perror.c was modified in these commits:

   
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=eaad82e00522075b805621309775131e27388791
   
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=aec84f53952315ac1bd91036e37113d9cb3a303b

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