Index: gdb/gnulib/import/m4/fcntl-o.m4 |
diff --git a/gdb/gnulib/import/m4/fcntl-o.m4 b/gdb/gnulib/import/m4/fcntl-o.m4 |
index 9862741f3943c38cc2269b8a582c5c4294ddf942..740e78b681987ec062b4db9e8fe8705a3a34b149 100644 |
--- a/gdb/gnulib/import/m4/fcntl-o.m4 |
+++ b/gdb/gnulib/import/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 |
{ |