Import upstream version 1.26
[debian/tar] / m4 / chown.m4
index ea3fe4c4c891dffc953553b735d01279d08fc606..f664e7c57f85cbdde67bbd7a5e02f01aa29bfc49 100644 (file)
@@ -1,7 +1,7 @@
-# serial 23
+# serial 24
 # Determine whether we need the chown wrapper.
 
-dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2010 Free Software
+dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009-2011 Free Software
 dnl Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
@@ -114,6 +114,7 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
         int
         main ()
         {
+          int result = 0;
           char const *dangling_symlink = "conftest.dangle";
 
           unlink (dangling_symlink);
@@ -122,8 +123,11 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
 
           /* Exit successfully on a conforming system,
              i.e., where chown must fail with ENOENT.  */
-          exit ( ! (chown (dangling_symlink, getuid (), getgid ()) != 0
-                    && errno == ENOENT));
+          if (chown (dangling_symlink, getuid (), getgid ()) == 0)
+            result |= 1;
+          if (errno != ENOENT)
+            result |= 2;
+          return result;
         }
         ]])],
         [gl_cv_func_chown_follows_symlink=yes],