This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/11312] popen should ignore 'b' in mode
- From: "xiyou dot wangcong at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 23 Feb 2010 09:45:40 -0000
- Subject: [Bug libc/11312] popen should ignore 'b' in mode
- References: <20100222232719.11312.ebb9@byu.net>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From xiyou dot wangcong at gmail dot com 2010-02-23 09:45 -------
(In reply to comment #0)
> For consistency with fopen and freopen, it would be nice if popen(cmd,"rb")
> behaved like popen(cmd,"r") rather than failing with EINVAL. In particular, the
> extension of supporting 'b' in the mode argument is already provided by Cygwin
> (although in cygwin, it actually makes a difference between text and binary
> pipes). POSIX does not forbid this extension.
>
> The request to allow applications to blindly request binary mode, even though it
> is otherwise a no-op in glibc, was first made here:
> http://lists.gnu.org/archive/html/bug-gnulib/2010-02/msg00195.html
>
> Likewise, it would be nice if other fopen extension flags were gracefully
> handled (silently ignore 'm', 'x', and honor 'c'), since 'e' is already a common
> extension between both fopen and popen. There is already precedence for this,
> since fdopen silently ignores 'x'.
It seems that ignoring 'b' makes sense.
Patch below does this.
--
http://sourceware.org/bugzilla/show_bug.cgi?id=11312
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.