Import upstream version 1.26
[debian/tar] / m4 / symlink.m4
index fb619846076bcfdd0d90d629395e44029297adee..917d5f0ec2cabba6b6fc0419b93ac0ebe3cd06b2 100644 (file)
@@ -1,7 +1,7 @@
-# serial 3
+# serial 4
 # See if we need to provide symlink replacement.
 
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -24,9 +24,16 @@ AC_DEFUN([gl_FUNC_SYMLINK],
       [AC_RUN_IFELSE(
          [AC_LANG_PROGRAM(
            [[#include <unistd.h>
-]], [[if (!symlink ("a", "conftest.link/")) return 1;
-      if (symlink ("conftest.f", "conftest.lnk2")) return 2;
-      if (!symlink ("a", "conftest.lnk2/")) return 3;]])],
+           ]],
+           [[int result = 0;
+             if (!symlink ("a", "conftest.link/"))
+               result |= 1;
+             if (symlink ("conftest.f", "conftest.lnk2"))
+               result |= 2;
+             else if (!symlink ("a", "conftest.lnk2/"))
+               result |= 4;
+             return result;
+           ]])],
          [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
          [gl_cv_func_symlink_works="guessing no"])
       rm -f conftest.f conftest.link conftest.lnk2])