strerror_r: avoid clobbering strerror on cygwin
authorEric Blake <eblake@redhat.com>
Sat, 21 May 2011 16:08:28 +0000 (10:08 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 21 May 2011 16:14:37 +0000 (10:14 -0600)
commit2f0357585d836b7349192ea4276b78adfd551cbc
tree6e85abc031d1a058c4c53db21c65216aef7ed87a
parentf56bca9f1091b3e6b3cf259d3a9f6c0859998a1c
strerror_r: avoid clobbering strerror on cygwin

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.
* modules/strerror (configure.ac): Add witness.
* tests/test-strerror_r.c (main): Enhance test.
* doc/posix-functions/strerror_r.texi (strerror_r): Document it.
* tests/test-perror2.c (main): Free memory before exit.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/posix-functions/strerror_r.texi
lib/strerror_r.c
modules/strerror
tests/test-perror2.c
tests/test-strerror_r.c