getcwd-lgpl: fix m4 to match relaxed test for BSD
authorEric Blake <eblake@redhat.com>
Wed, 17 Aug 2011 22:14:12 +0000 (16:14 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 17 Aug 2011 22:43:59 +0000 (16:43 -0600)
commit1a6fbdd7d28dff1868c5eb0baf0029b27e42526a
tree5f88109805d3976444b89f3a62ed2f81f31bd9c9
parent07809063056aef043ba738ab8229042f1ffc9659
getcwd-lgpl: fix m4 to match relaxed test for BSD

Commit c6dc8f1 changed test-getcwd-lgpl to allow BSD behavior
where getcwd(NULL,1) allocates the proper size, in addition to
the glibc behavior of allocating exactly one byte then failing
with ERANGE.  But the m4 test was still rejecting the former
behavior.

However, merely fixing the test to avoid probing the behavior
would be a regression of commit 8585ce2, since it was the only
reason why rpl_getcwd was being compiled on mingw.  Hence, we
have to add a signature check in its place to keep mingw happy.

* m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): Relax probe.
(gl_FUNC_GETCWD_SIGNATURE): New macro.
(gl_FUNC_GETCWD_LGPL, gl_FUNC_GETCWD): Use it.
* doc/posix-functions/getcwd.texi (getcwd): Tweak mentions of
signature problem.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
doc/posix-functions/getcwd.texi
m4/getcwd.m4