Skip to content

Commit 2dbc1b0

Browse files
authored
Disable compiling with poll() on macOS (#393)
I've noticed recently that when using the bundled curl version on macOS, very occasionally curl will get "stuck" in the TCP connection phase when using the multi interface. Apparently this is caused by the `poll()` implementation not behaving quite as the POSIX standard says it should on some macOS versions. This originally was a problem just for macOS 10.12, but after a recent update it seems like this regression might have come back in 10.15. It is better to just disable `poll()` completely on macOS, which the official build configuration does here: https://github.com/curl/curl/blob/1e19eceb50d6d8b9c9b37e2f8e1259b2f311c82a/m4/curl-functions.m4#L4999-L5010 See also curl/curl#1057 when this was originally reported way back in the day.
1 parent 1931312 commit 2dbc1b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

curl-sys/build.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ fn main() {
300300
.define("HAVE_NETDB_H", None)
301301
.define("HAVE_NETINET_IN_H", None)
302302
.define("HAVE_NETINET_TCP_H", None)
303-
.define("HAVE_POLL_FINE", None)
304303
.define("HAVE_POLL_H", None)
305304
.define("HAVE_FCNTL_O_NONBLOCK", None)
306305
.define("HAVE_SYS_SELECT_H", None)
@@ -336,7 +335,11 @@ fn main() {
336335
.define("HAVE_MACH_ABSOLUTE_TIME", None);
337336
} else {
338337
cfg.define("HAVE_CLOCK_GETTIME_MONOTONIC", None)
339-
.define("HAVE_GETTIMEOFDAY", None);
338+
.define("HAVE_GETTIMEOFDAY", None)
339+
// poll() on various versions of macOS are janky, so only use it
340+
// on non-macOS unix-likes. This matches the official default
341+
// build configuration as well.
342+
.define("HAVE_POLL_FINE", None);
340343
}
341344

342345
if cfg!(feature = "spnego") {

0 commit comments

Comments
 (0)