]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
build: drop unused feature-detection code for Apple `poll()`
authorViktor Szakats <commit@vsz.me>
Thu, 29 Aug 2024 08:15:26 +0000 (10:15 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 29 Aug 2024 15:54:53 +0000 (17:54 +0200)
Drop Apple-specific detection logic for `poll()`. This detection snippet
has been disabled for Apple in both configure and cmake, for `poll()`
being broken on Apple since 10.12 Sierra (2016).

Also replace `exit(1);` with `return 1;` in configure, to make the
snippets match.

Added in 9297ca49f5f3caca938a679b9c1feeb719e61ddb #1057 (2016-10-11).

Disabled for:
configure/darwin in a34c7ce7546f39f24692925d66c2f42324dd94e9 (2016-10-18)
cmake/macOS in 825911be587bbabc3b7e4777ed3bd1bb7c858b58 #7619
cmake/iOS in d14831233df3a15b14db563156614c9ea60fcf06 #8244
cmake/all Apple in a86254b39307af1a53735b065a382567805cd9b8 #12515

Closes #14718

CMake/OtherTests.cmake
m4/curl-functions.m4

index 904c1c80e5749badf34ca19b3169cab8b0936479..faba1484c025c08aebf548ef32119de914827b43 100644 (file)
@@ -88,23 +88,6 @@ if(NOT CMAKE_CROSSCOMPILING AND NOT APPLE)
       if(0 != poll(0, 0, 10)) {
         return 1; /* fail */
       }
-      else {
-        /* detect the 10.12 poll() breakage */
-        struct timeval before, after;
-        int rc;
-        size_t us;
-
-        gettimeofday(&before, NULL);
-        rc = poll(NULL, 0, 500);
-        gettimeofday(&after, NULL);
-
-        us = (after.tv_sec - before.tv_sec) * 1000000 +
-          (after.tv_usec - before.tv_usec);
-
-        if(us < 400000) {
-          return 1;
-        }
-      }
       return 0;
     }" HAVE_POLL_FINE)
 endif()
index 7a35b98ffe3a565b128c2b623d457fd4aaea8478..6c6adca4b5da3b0ea78ea39e65aefdf1c64b9cce 100644 (file)
@@ -3477,26 +3477,10 @@ AC_DEFUN([CURL_CHECK_FUNC_POLL], [
       AC_LANG_PROGRAM([[
         $curl_includes_stdlib
         $curl_includes_poll
-        $curl_includes_time
       ]],[[
         /* detect the original poll() breakage */
-        if(0 != poll(0, 0, 10))
-          exit(1); /* fail */
-        else {
-          /* detect the 10.12 poll() breakage */
-          struct timeval before, after;
-          int rc;
-          size_t us;
-
-          gettimeofday(&before, NULL);
-          rc = poll(NULL, 0, 500);
-          gettimeofday(&after, NULL);
-
-          us = (after.tv_sec - before.tv_sec) * 1000000 +
-            (after.tv_usec - before.tv_usec);
-
-          if(us < 400000)
-            exit(1);
+        if(0 != poll(0, 0, 10)) {
+          return 1; /* fail */
         }
       ]])
     ],[