getcwd: break fdopendir + save_cwd recursive loop (Bug#13516)
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Feb 2013 05:28:30 +0000 (21:28 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Feb 2013 05:28:52 +0000 (21:28 -0800)
commitca369c8d661a10d8a0ae3d712e7dfa91664921f1
treec640802ca72aa941ef300ce1018b79f35347a312
parent6668cfa30c1b2f636b2db12327a6e87fe613e534
getcwd: break fdopendir + save_cwd recursive loop (Bug#13516)

Reported for OS X 10.8.2 by Assaf Gordon in
<http://bugs.gnu.org/13516>.
* lib/getcwd.c (HAVE_OPENAT_SUPPORT): Do not define if
!HAVE_OPENAT && !HAVE_FDOPENDIR.
* m4/getcwd-abort-bug.m4: Reformat to match test-getcwd.c
so that they can be kept in sync more easily.  Avoid PATH_MAX
test on the Hurd.  Sync from test-getcwd.c for errno tests after
mkdir or chdir failure.
* tests/test-getcwd.c (HAVE_OPENAT_SUPPORT): New macro, from
lib/getcwd.c.
(test_abort_bug): Do not test for the deep directory bug unless we
have openat support.  Avoid PATH_MAX test on the Hurd.
ChangeLog
lib/getcwd.c
m4/getcwd-abort-bug.m4
tests/test-getcwd.c