diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-10 13:37:18 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-10 13:37:43 -0700 |
commit | 58db8531e5a2544ce6ef1ccb370f67ff97901381 (patch) | |
tree | 3972c433984a968d869be69623cdafc842cc9f48 /m4 | |
parent | d8d412ccd90c93b160825ed6de89ec309d4cdbba (diff) | |
download | gnulib-58db8531e5a2544ce6ef1ccb370f67ff97901381.tar.gz |
fcntl-h: check for AIX 7.1 bug with O_NOFOLLOW and O_CREAT
* m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): Check for AIX 7.1 bug
that caused a GNU tar test failure. Problem reported by Jez Wain; see
<http://lists.gnu.org/archive/html/bug-tar/2012-07/msg00018.html>.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/fcntl-o.m4 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4 index 9862741f39..a413810e03 100644 --- a/m4/fcntl-o.m4 +++ b/m4/fcntl-o.m4 @@ -50,7 +50,18 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; - if (symlink (".", sym) != 0) + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 1; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) result |= 2; else { |