[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] strerror_r: avoid clobbering strerror on cygwin

From: Eric Blake
Subject: Re: [PATCH] strerror_r: avoid clobbering strerror on cygwin
Date: Sat, 21 May 2011 19:06:06 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/21/2011 12:27 PM, Bruno Haible wrote:
> Eric Blake wrote:
>> Avoid cygwin strerror_r, since it clobbers strerror buffer through
>> cygwin 1.7.9.  __xpg_strerror_r is okay, but if a program is
>> compiled on cygwin 1.7.8 or earlier, it is not available.
>> * lib/strerror_r.c (strerror_r): Don't use cygwin's strerror_r;
>> fall back instead to sys_errlist.
> Good point.
>> -/* Get sys_nerr, sys_errlist on native Windows.  */
>> +/* Get sys_nerr, sys_errlist on native Windows and Cygwin.  */
>>  #  include <stdlib.h>
> sys_nerr and sys_errlist are already declared in <errno.h>, on Cygwin 1.5.x
> and 1.7.x, like on many other platforms. It this comment change OK with you?

Oh, I see what I did wrong - I did 'find /usr/include -name \*.h | xargs
grep sys_nerr', and the result listed mingw/stdlib.h alongside
sys/errno.h (which is the guts of <errno.h> on cygwin).  I gravitated to
the wrong header, without realizing that stdlib.h was mingw only.

Yes, your followup patch is fine.

Eric Blake   address@hidden    +1-801-349-2682
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]