]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tail,tee: fix broken pipe detection on darwin 9
authorPádraig Brady <P@draigBrady.com>
Tue, 26 Nov 2024 14:04:32 +0000 (14:04 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 26 Nov 2024 16:02:01 +0000 (16:02 +0000)
* src/iopoll.c (): Restrict use of poll() on macOS
to >= 11 (darwin 20), as it was seen to fail on macOS 10.5.
Fixes https://bugs.gnu.org/74503

src/iopoll.c

index 8e5c92dd8dcfdca5c6e5e0b785e97345c6626c44..174048639a64be8bb3aeb18f5315a21ce98a5b0f 100644 (file)
 /* poll(2) is needed on AIX (where 'select' gives a readable
    event immediately) and Solaris (where 'select' never gave
    a readable event).  Also use poll(2) on systems we know work
-   and/or are already using poll (linux).  */
-
-#if defined _AIX || defined __sun || defined __APPLE__ || \
-    defined __linux__ || defined __ANDROID__
+   and/or are already using poll (linux).  On macOS we know poll()
+   doesn't work on 10.5, while it does work on >= 11 at least. */
+#if defined _AIX || defined __sun \
+    || defined __linux__ || defined __ANDROID__ \
+    || __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 110000
 # define IOPOLL_USES_POLL 1
   /* Check we've not enabled gnulib's poll module
      as that will emulate poll() in a way not