X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Ffcntl-o.m4;h=43c93124ed5874a66282ed01b365a4fcfb9c1632;hb=1276a2c5f24c0c932426aca9c899fa524d2443f2;hp=9862741f3943c38cc2269b8a582c5c4294ddf942;hpb=1602f0afed21be664fcf5c42d59db07cc22c56d6;p=gnulib.git diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4 index 9862741f3..43c93124e 100644 --- a/m4/fcntl-o.m4 +++ b/m4/fcntl-o.m4 @@ -1,5 +1,5 @@ # fcntl-o.m4 serial 4 -dnl Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2014 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. @@ -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 |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) result |= 2; else {