[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 0/4] Cross compiling sharutils
From: |
Eric Blake |
Subject: |
Re: [PATCH 0/4] Cross compiling sharutils |
Date: |
Thu, 21 May 2015 08:40:29 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 05/20/2015 10:40 PM, Filipe Brandenburger wrote:
> Looking at the cygwin popen implementation (assuming I have the right
> one), it doesn't really look like they look for a 'b' and handle that
> any differently:
>
> https://cygwin.com/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libc/posix/popen.c;h=faf72b6e380a8f74cc6af590a540b9fe292aab28;hb=HEAD#l120
Wrong source. That's the generic newlib implementation of popen, but
cygwin overrides with its own version at:
https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/syscalls.cc;h=86faa3;hb=HEAD#l4297
which indeed treats "rb" differently from "r" and the extension "rt".
>
> So I'm really at a loss at why this code was even there, as I can't
> really think of another platform that would conceivably handle
> popen("rb") different from popen("r") if cygwin doesn't...
But cygwin DOES care about "rb"; if you don't pass the 'b', then you
risk \r being unexpectedly stripped from the command's output.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, (continued)
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/22
- [PATCH 1/2] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/22
- [PATCH 2/2] Be more careful in guarding against pathological "begin" lines, Filipe Brandenburger, 2015/05/22
- Re: [PATCH 1/2] Use O_BINARY to detect whether to pass "rb" to popen, cowan, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/23
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/29
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/29
- Re: [PATCH 0/4] Cross compiling sharutils,
Eric Blake <=
- Re: [PATCH 0/4] Cross compiling sharutils, Eli Zaretskii, 2015/05/21
- Re: [PATCH 0/4] Cross compiling sharutils, Filipe Brandenburger, 2015/05/22
- Re: [PATCH 0/4] Cross compiling sharutils, Eli Zaretskii, 2015/05/22
- Re: [PATCH 0/4] Cross compiling sharutils, Eric Blake, 2015/05/22
- Re: [PATCH 0/4] Cross compiling sharutils, Eli Zaretskii, 2015/05/21
- Re: [PATCH 0/4] Cross compiling sharutils, Eli Zaretskii, 2015/05/21