From 83da1cefed54e220ab1ca2fff1df7c2db23d5204 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 1 Aug 2026 19:41:20 +1000 Subject: [PATCH] build: require , not just poll() io.c and socket.c include unconditionally, but configure only required the function. A system that exposes poll() through some other header would pass configure and then fail to compile -- the AC_CHECK_HEADERS result for poll.h was collected and never used. Require the header too, with its own message. Verified both ways: a normal configure still succeeds, and forcing ac_cv_header_poll_h=no now stops with "rsync requires " rather than failing later in the build. (cherry picked from commit a0952930a16c7e9cafd3e41a22521770b54d3970) --- configure.ac | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure.ac b/configure.ac index 30301125..eb09ad89 100644 --- a/configure.ac +++ b/configure.ac @@ -895,7 +895,14 @@ dnl rsync's I/O readiness loops use poll() rather than select() so that a dnl file descriptor at or above FD_SETSIZE cannot overflow an fd_set (which dnl is undefined behaviour and could hang the transfer). poll() is in dnl POSIX.1-2001; fail early and clearly if this target lacks it. +dnl +dnl io.c and socket.c include unconditionally, so the HEADER has to +dnl be required too: a system that exposes poll() through some other header +dnl would otherwise pass configure and then fail to compile. AC_CHECK_FUNCS([poll], , [AC_MSG_ERROR([rsync requires poll(); please report the platform to the rsync developers])]) +if test x"$ac_cv_header_poll_h" != x"yes"; then + AC_MSG_ERROR([rsync requires ; please report the platform to the rsync developers]) +fi AC_CHECK_FUNCS(strcasecmp) if test x"$ac_cv_func_strcasecmp" = x"no"; then