perror: work around FreeBSD bug
POSIX requires that 'errno = 0; perror ("")' print the same message
as strerror(0), but this failed if we were replacing strerror to work
around the FreeBSD bug of treating 0 as a failure.
The goal here is to _not_ replace perror on glibc, even though
strerror_r has to be replaced, because the strerror_r replacement is
only for the sake of correcting the signature rather than working
around bugs in the handling of any particular errnum value. Recall
that $gl_cv_func_strerror_r_works is only set if the POSIX signature
was detected in the first place.
* m4/perror.m4 (gl_FUNC_PERROR): Also replace perror if strerror_r
is broken. Move AC_LIBOBJ...
* modules/perror (configure.ac): Here.
* doc/posix-functions/perror.texi (perror): Document this.
* tests/test-perror2.c (main): Enhance test.
Signed-off-by: Eric Blake <eblake@redhat.com>