2011-04-29 Jim Meyering <meyering@redhat.com>
+ test-getcwd.c: avoid new set-but-not-used warning
+ * tests/test-getcwd.c (test_abort_bug): Exit nonzero for any problem,
+ not just the glibc/abort one that getcwd-abort-bug.m4 detects.
+ * m4/getcwd-abort-bug.m4: Update this now-duplicated code to match,
+ and adjust the code that sets gl_cv_func_getcwd_abort_bug accordingly.
+
test-hash.c: avoid a new shadowing warning
* tests/test-hash.c (main): Don't shadow "dup".
-# serial 3
+# serial 4
# Determine whether getcwd aborts when the length of the working directory
# name is unusually large. Any length between 4k and 16k trigger the bug
# when using glibc-2.4.90-9 or older.
cwd = getcwd (NULL, 0);
if (cwd == NULL)
- return 0;
+ return 2;
initial_cwd_len = strlen (cwd);
free (cwd);
while (0 < d--)
{
if (chdir ("..") < 0)
- break;
+ {
+ fail = 5;
+ break;
+ }
rmdir (dir_name);
}
- return 0;
+ return fail;
}
]])],
[gl_cv_func_getcwd_abort_bug=no],
- [gl_cv_func_getcwd_abort_bug=yes],
+ dnl A "regular" nonzero return does not indicate this bug.
+ dnl An abort will provoke an exit code of something like 134 (128 + 6).
+ [test $? -gt 128 \
+ && gl_cv_func_getcwd_abort_bug=yes \
+ || gl_cv_func_getcwd_abort_bug=no],
[gl_cv_func_getcwd_abort_bug=yes])
])
AS_IF([test $gl_cv_func_getcwd_abort_bug = yes], [$1], [$2])