]> Savannah Git Hosting - gnulib.git/commitdiff
mkfifoat: Work around a macOS 14 bug.
authorBruno Haible <bruno@clisp.org>
Sun, 19 May 2024 09:55:13 +0000 (11:55 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 19 May 2024 09:55:13 +0000 (11:55 +0200)
* m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Also test the case of a dangling
symlink.
* doc/posix-functions/mkfifoat.texi: Mention the macOS bug.

ChangeLog
doc/posix-functions/mkfifoat.texi
m4/mkfifoat.m4

index b7f62031f3d3e4bff850acf9d244ca4534bcc485..a4ed70af3217865637e5fd4621a54e78e76f3f4a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-05-18  Bruno Haible  <bruno@clisp.org>
+
+       mkfifoat: Work around a macOS 14 bug.
+       * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Also test the case of a dangling
+       symlink.
+       * doc/posix-functions/mkfifoat.texi: Mention the macOS bug.
+
 2024-05-18  Paul Eggert  <eggert@cs.ucla.edu>
 
        sha512-buffer: port back to 32-bit-only hosts
index 15dce299274ca27fcbc1b0b5d17221022b5fc1d5..298c2eaf022160cc59b681439de4380534f043b9 100644 (file)
@@ -16,6 +16,10 @@ But the replacement function is not safe to be used in libraries and is not mult
 This function does not fail when the file name argument ends in a slash
 and (without the slash) names a nonexistent file, on some platforms:
 AIX 7.2.
+@item
+This function does not fail when the file name argument ends in a slash
+and (without the slash) names a symbolic link, on some platforms:
+macOS 14.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 9efffd58bbd6950bcebec18325abc0d499deca89..763f8700066b949597ed020d7ddc4fb205a956bd 100644 (file)
@@ -1,5 +1,5 @@
 # mkfifoat.m4
-# serial 10
+# serial 11
 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,7 +22,7 @@ AC_DEFUN([gl_FUNC_MKFIFOAT],
   gl_CHECK_FUNCS_ANDROID_MACOS([mknodat], [[#include <sys/stat.h>]])
   gl_CHECK_FUNCS_ANDROID_MACOS([mkfifoat], [[#include <sys/stat.h>]])
   if test $ac_cv_func_mkfifoat = yes; then
-    dnl Check for AIX 7.2 bug with trailing slash.
+    dnl Check for AIX 7.2 bug and macOS 14 bugs with trailing slash.
     AC_CACHE_CHECK([whether mkfifoat rejects trailing slashes],
       [gl_cv_func_mkfifoat_works],
       [rm -f conftest.tmp
@@ -30,10 +30,16 @@ AC_DEFUN([gl_FUNC_MKFIFOAT],
          [AC_LANG_PROGRAM(
             [[#include <fcntl.h>
               #include <sys/stat.h>
+              #include <unistd.h>
             ]],
             [[int result = 0;
+              /* This test fails on AIX 7.2.  */
               if (!mkfifoat (AT_FDCWD, "conftest.tmp/", 0600))
                 result |= 1;
+              /* This test fails on macOS 14.  */
+              if (!symlink ("conftest.fifo", "conftest.tmp")
+                  && !mkfifoat (AT_FDCWD, "conftest.tmp/", 0600))
+                result |= 2;
               return result;
             ]])
          ],
@@ -44,6 +50,8 @@ AC_DEFUN([gl_FUNC_MKFIFOAT],
             linux-* | linux) gl_cv_func_mkfifoat_works="guessing yes" ;;
                              # Guess yes on glibc systems.
             *-gnu* | gnu*)   gl_cv_func_mkfifoat_works="guessing yes" ;;
+                             # Guess no on macOS systems.
+            darwin*)         gl_cv_func_mkfifoat_works="guessing no" ;;
                              # Guess no on AIX systems.
             aix*)            gl_cv_func_mkfifoat_works="guessing no" ;;
                              # If we don't know, obey --enable-cross-guesses.