bug-gnu-utils
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]