X-Git-Url: https://git.hcoop.net/bpt/guile.git/blobdiff_plain/35428fb6b2d269dbfa2eec7d0739aec149bd4cc2..3f4829e082c2fdd0553a6ce97fe173f8df327e7b:/m4/fcntl-o.m4 diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4 index bee6edc11..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-2011 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 {