[openssh-commits] [openssh] 02/11: Create replacement poll.h if needed.
git+noreply at mindrot.org
git+noreply at mindrot.org
Fri Sep 5 18:10:22 AEST 2025
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
commit d45b17dc5a0598dda2b11dc89598203408d2d59c
Author: Darren Tucker <dtucker at dtucker.net>
AuthorDate: Fri Sep 5 17:17:52 2025 +1000
Create replacement poll.h if needed.
Remove #ifdef HAVE_POLL_H wrapper. ok djm@
---
atomicio.c | 6 ------
channels.c | 2 --
clientloop.c | 2 --
configure.ac | 6 ++++--
kex.c | 2 --
misc.c | 2 --
monitor.c | 6 ------
monitor_fdpass.c | 8 +-------
mux.c | 6 ------
openbsd-compat/bsd-poll.h | 6 +-----
packet.c | 2 --
regress/netcat.c | 6 ------
regress/unittests/misc/test_ptimeout.c | 4 +---
scp.c | 6 ------
serverloop.c | 2 --
sftp-client.c | 6 ------
sftp-server.c | 2 --
ssh-agent.c | 4 +---
ssh-keyscan.c | 2 --
ssh-pkcs11-helper.c | 2 --
sshconnect.c | 2 --
sshd.c | 2 --
22 files changed, 8 insertions(+), 78 deletions(-)
diff --git a/atomicio.c b/atomicio.c
index 765073357..58a9512d3 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -31,13 +31,7 @@
#include <sys/uio.h>
#include <errno.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
#include <string.h>
#include <unistd.h>
#include <limits.h>
diff --git a/channels.c b/channels.c
index 5dbf428aa..b489cb9a9 100644
--- a/channels.c
+++ b/channels.c
@@ -57,9 +57,7 @@
#include <fcntl.h>
#include <limits.h>
#include <netdb.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
diff --git a/clientloop.c b/clientloop.c
index 577771f06..38100d18a 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -76,9 +76,7 @@
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/configure.ac b/configure.ac
index fffe2f407..923a01af1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -481,7 +481,6 @@ AC_CHECK_HEADERS([ \
netgroup.h \
pam/pam_appl.h \
paths.h \
- poll.h \
pty.h \
readpassphrase.h \
rpc/types.h \
@@ -535,10 +534,13 @@ AC_CHECK_HEADERS([ \
# the equivalent file. This avoids having to wrap those includes in
# '#ifdef HAVE_FOO_H'. If we create any such headers, add the path to includes.
compatincludes=no
-AC_CHECK_HEADERS([stdint.h], [], [
+AC_CHECK_HEADERS([poll.h stdint.h], [], [
compatincludes="`pwd`/openbsd-compat/include"
mkdir -p "$compatincludes"
case "$ac_header" in
+ poll.h) echo '#ifdef HAVE_SYS_POLL_H'
+ echo '#include <sys/poll.h>'
+ echo '#endif' ;;
*) ;;
esac >"$compatincludes/$ac_header"
])
diff --git a/kex.c b/kex.c
index f8eaa8c97..6e312985f 100644
--- a/kex.c
+++ b/kex.c
@@ -33,9 +33,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#ifdef WITH_OPENSSL
#include <openssl/crypto.h>
diff --git a/misc.c b/misc.c
index 4e09f2b4b..728e80b04 100644
--- a/misc.c
+++ b/misc.c
@@ -33,9 +33,7 @@
#ifdef HAVE_LIBGEN_H
# include <libgen.h>
#endif
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#ifdef HAVE_NLIST_H
#include <nlist.h>
#endif
diff --git a/monitor.c b/monitor.c
index d0a2b3f50..166f4d2c4 100644
--- a/monitor.c
+++ b/monitor.c
@@ -45,13 +45,7 @@
#include <stdarg.h>
#include <stdio.h>
#include <unistd.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
#ifdef WITH_OPENSSL
#include <openssl/dh.h>
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index d7bf38979..5c0523fb3 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -37,13 +37,7 @@
#include <string.h>
#include <stdarg.h>
-#ifdef HAVE_POLL_H
-# include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
+#include <poll.h>
#include "log.h"
#include "monitor_fdpass.h"
diff --git a/mux.c b/mux.c
index 542024e7a..103746a90 100644
--- a/mux.c
+++ b/mux.c
@@ -38,13 +38,7 @@
#include <paths.h>
#endif
-#ifdef HAVE_POLL_H
#include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
#ifdef HAVE_UTIL_H
# include <util.h>
diff --git a/openbsd-compat/bsd-poll.h b/openbsd-compat/bsd-poll.h
index ae865a6e2..67fd8c66f 100644
--- a/openbsd-compat/bsd-poll.h
+++ b/openbsd-compat/bsd-poll.h
@@ -31,11 +31,7 @@
#define _COMPAT_POLL_H_
#include <sys/types.h>
-#ifdef HAVE_POLL_H
-# include <poll.h>
-#elif HAVE_SYS_POLL_H
-# include <sys/poll.h>
-#endif
+#include <poll.h>
#ifndef HAVE_STRUCT_POLLFD_FD
typedef struct pollfd {
diff --git a/packet.c b/packet.c
index 6dfa7ac31..6af84ed85 100644
--- a/packet.c
+++ b/packet.c
@@ -58,9 +58,7 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <signal.h>
#include <time.h>
diff --git a/regress/netcat.c b/regress/netcat.c
index 1eac0218a..0acedfd82 100644
--- a/regress/netcat.c
+++ b/regress/netcat.c
@@ -55,13 +55,7 @@
#include <unistd.h>
#include "atomicio.h"
-#ifdef HAVE_POLL_H
#include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
#ifdef HAVE_ERR_H
# include <err.h>
#endif
diff --git a/regress/unittests/misc/test_ptimeout.c b/regress/unittests/misc/test_ptimeout.c
index 359a460cc..f56e88996 100644
--- a/regress/unittests/misc/test_ptimeout.c
+++ b/regress/unittests/misc/test_ptimeout.c
@@ -12,9 +12,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_POLL_H
-# include <poll.h>
-#endif
+#include <poll.h>
#include <time.h>
#include "../test_helper/test_helper.h"
diff --git a/scp.c b/scp.c
index f7328e5b3..67bd9d28d 100644
--- a/scp.c
+++ b/scp.c
@@ -77,13 +77,7 @@
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#ifdef HAVE_POLL_H
#include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
diff --git a/serverloop.c b/serverloop.c
index 4beb2a390..ff207721d 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -50,9 +50,7 @@
#include <fcntl.h>
#include <pwd.h>
#include <limits.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <signal.h>
#include <string.h>
#include <termios.h>
diff --git a/sftp-client.c b/sftp-client.c
index 3d8bb3496..880064c1e 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -37,13 +37,7 @@
#include <dirent.h>
#include <errno.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#else
-# ifdef HAVE_SYS_POLL_H
-# include <sys/poll.h>
-# endif
-#endif
#include <fcntl.h>
#include <signal.h>
#include <stdarg.h>
diff --git a/sftp-server.c b/sftp-server.c
index c3baebd86..0d1452102 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -33,9 +33,7 @@
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <pwd.h>
#include <grp.h>
#include <stdlib.h>
diff --git a/ssh-agent.c b/ssh-agent.c
index 2c7b94be5..3ea1a4d8d 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -60,9 +60,7 @@
#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
-#ifdef HAVE_POLL_H
-# include <poll.h>
-#endif
+#include <poll.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 914de1244..46208f117 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -26,9 +26,7 @@
#include <limits.h>
#include <netdb.h>
#include <errno.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/ssh-pkcs11-helper.c b/ssh-pkcs11-helper.c
index 32111fef6..279cd1df1 100644
--- a/ssh-pkcs11-helper.c
+++ b/ssh-pkcs11-helper.c
@@ -24,9 +24,7 @@
#include <stdlib.h>
#include <errno.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
diff --git a/sshconnect.c b/sshconnect.c
index 8ddc531da..8f8e960ec 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -36,9 +36,7 @@
#include <paths.h>
#endif
#include <pwd.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/sshd.c b/sshd.c
index 86c27c44c..60d0d1ff1 100644
--- a/sshd.c
+++ b/sshd.c
@@ -47,9 +47,7 @@
#include <paths.h>
#endif
#include <grp.h>
-#ifdef HAVE_POLL_H
#include <poll.h>
-#endif
#include <pwd.h>
#include <signal.h>
#include <stdarg.h>
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list