getcwd: fix test failures on mingw
authorEric Blake <eblake@redhat.com>
Wed, 17 Aug 2011 23:51:47 +0000 (17:51 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 17 Aug 2011 23:49:17 +0000 (17:49 -0600)
commit56d6664559f449af25f0d331457b014b02324d65
tree97bb339092893f28d2368a7a86437ae08538b5c2
parent1a6fbdd7d28dff1868c5eb0baf0029b27e42526a
getcwd: fix test failures on mingw

The GPL getcwd replacement now kicks in for mingw thanks to the
signature check, but does not have to do anything.  However,
because the code was not taking an early exit for ERANGE when
a buffer size was given, it instead tried to second-guess
mingw's cwd algorithm, which doesn't work.  After fixing that,
the tests still failed, even though mingw getcwd doesn't have
any problems with long paths (since they can't be created in
the first place).

* lib/getcwd.c (__getcwd): Early exit for ERANGE.
* tests/test-getcwd.c (test_abort_bug, test_long_name): Don't fail
test if long directory cannot be created, and allow mingw errno.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/getcwd.c
tests/test-getcwd.c