X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fchown.m4;h=f664e7c57f85cbdde67bbd7a5e02f01aa29bfc49;hb=307b5ac2b6178047bff4af5f9cf35d5dbc99d6f8;hp=b907305dd614e8c34687a5445e84848de7c4d274;hpb=3030c5b5e0a5199e16b05927da72c43c42f211c3;p=gnulib.git diff --git a/m4/chown.m4 b/m4/chown.m4 index b907305dd..f664e7c57 100644 --- a/m4/chown.m4 +++ b/m4/chown.m4 @@ -1,8 +1,8 @@ -# serial 22 +# serial 24 # Determine whether we need the chown wrapper. -dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009 Free Software Foundation, -dnl Inc. +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 dnl gives unlimited permission to copy and/or distribute it, @@ -43,6 +43,7 @@ AC_DEFUN_ONCE([gl_FUNC_CHOWN], dnl Solaris 9 ignores trailing slash. dnl FreeBSD 7.2 mishandles trailing slash on symlinks. + dnl Likewise for AIX 7.1. AC_CACHE_CHECK([whether chown honors trailing slash], [gl_cv_func_chown_slash_works], [touch conftest.file && rm -f conftest.link @@ -113,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); @@ -121,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],