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 [email protected] +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
