summaryrefslogtreecommitdiff
path: root/m4/fcntl-o.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/fcntl-o.m4')
-rw-r--r--m4/fcntl-o.m413
1 files changed, 12 insertions, 1 deletions
diff --git a/m4/fcntl-o.m4 b/m4/fcntl-o.m4
index 9862741f3..740e78b68 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 |= 4;
+ }
+ }
+ if (unlink (sym) != 0 || symlink (".", sym) != 0)
result |= 2;
else
{