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)
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>

No differences found