From 269044136fa1d73a6bc1a764211cc18119bc1207 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 23 Apr 2020 05:39:46 -0700 Subject: sockets: connect bugfix and use poll in preference to select. * configure: cosmetics: change HAVE_SYS_SELECT to HAVE_SELECT, and log that the function rather than the header is being detected. * socket.c (fd_timeout): New function, implemented using poll or select. (to_connect): select logic replaced with fd_timeout. Bug fixed: connect requires polling for writability, not readability. If poll and select are not available, ignore timeout argument. (sock_accept): Use fd_timeout; fall back on non-timed-out accept if poll or select not available. --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure') diff --git a/configure b/configure index ef5f75ec..aa2a738e 100755 --- a/configure +++ b/configure @@ -3324,7 +3324,7 @@ else fi if [ $have_sockets ] ; then - printf "Checking whether we have ... " + printf "Checking for select ... " cat > conftest.c < @@ -3341,7 +3341,7 @@ int main(int argc, char **argv) ! if conftest; then printf "yes\n" - printf "#define HAVE_SYS_SELECT_H 1\n" >> config.h + printf "#define HAVE_SELECT 1\n" >> config.h else printf "no\n" fi -- cgit v1.2.3