X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=m4%2Fgetcwd-abort-bug.m4;h=59c3daaa52ba3134c9907a60be2abb5d389aed83;hb=HEAD;hp=a431a7ccc03d5add8a07c457f7dff0270225a769;hpb=138fc7e67e3d9845cd7d81aad0e9c7724784f9b9;p=tar diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4 index a431a7c..59c3daa 100644 --- a/m4/getcwd-abort-bug.m4 +++ b/m4/getcwd-abort-bug.m4 @@ -1,9 +1,9 @@ -#serial 1 +# serial 2 # 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. -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -13,8 +13,8 @@ # gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], [ - AC_CHECK_DECLS_ONCE(getcwd) - AC_CHECK_FUNCS(getpagesize) + AC_CHECK_DECLS_ONCE([getcwd]) + AC_CHECK_FUNCS([getpagesize]) AC_CACHE_CHECK([whether getcwd aborts when 4k < cwd_length < 16k], gl_cv_func_getcwd_abort_bug, [# Remove any remnants of a previous test. @@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG], ac_clean_files="$ac_clean_files confdir-14B---" AC_RUN_IFELSE( [AC_LANG_SOURCE( - [[ + [[ #include #include #include @@ -69,14 +69,14 @@ main () initial_cwd_len = strlen (cwd); free (cwd); desired_depth = ((TARGET_LEN - 1 - initial_cwd_len) - / (1 + strlen (dir_name))); + / (1 + strlen (dir_name))); for (d = 0; d < desired_depth; d++) { if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0) - { - fail = 3; /* Unable to construct deep hierarchy. */ - break; - } + { + fail = 3; /* Unable to construct deep hierarchy. */ + break; + } } /* If libc has the bug in question, this invocation of getcwd @@ -91,7 +91,7 @@ main () while (0 < d--) { if (chdir ("..") < 0) - break; + break; rmdir (dir_name); }