X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Funlink.m4;h=1c559af67d18080d6df88becd39e11f900b3e26c;hb=423d3cac13c30bb0d5f85e5fac6ab1406ed1731a;hp=e485c6f0bae550feb5acd62be57751a836d837f1;hpb=00fd464074ca1c0aafca898ee9f2b36047dec2cc;p=gnulib.git diff --git a/m4/unlink.m4 b/m4/unlink.m4 index e485c6f0b..1c559af67 100644 --- a/m4/unlink.m4 +++ b/m4/unlink.m4 @@ -1,4 +1,4 @@ -# unlink.m4 serial 5 +# unlink.m4 serial 6 dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -21,11 +21,20 @@ AC_DEFUN([gl_FUNC_UNLINK], [AC_LANG_PROGRAM( [[#include #include -]], [[if (!unlink ("conftest.file/") || errno != ENOTDIR) return 1; + ]], + [[int result = 0; + if (!unlink ("conftest.file/")) + result |= 1; + else if (errno != ENOTDIR) + result |= 2; #if HAVE_LSTAT - if (!unlink ("conftest.lnk/") || errno != ENOTDIR) return 2; + if (!unlink ("conftest.lnk/")) + result |= 4; + else if (errno != ENOTDIR) + result |= 8; #endif - ]])], + return result; + ]])], [gl_cv_func_unlink_honors_slashes=yes], [gl_cv_func_unlink_honors_slashes=no], [gl_cv_func_unlink_honors_slashes="guessing no"]) @@ -65,9 +74,12 @@ AC_DEFUN([gl_FUNC_UNLINK], #include int main () { + int result = 0; if (chdir (getenv ("GL_SUBDIR_FOR_UNLINK")) != 0) - return 1; - return unlink ("..") == 0; + result |= 1; + else if (unlink ("..") == 0) + result |= 2; + return result; } ]])], [gl_cv_func_unlink_parent_fails=yes],