[openssh-commits] [openssh] 01/01: revert c64b62338b4 and guard POLL* defines instead

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Oct 17 09:42:33 AEDT 2022


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 195e5a65fd793a738ea8451ebfdd1919db5aff3e
Author: Damien Miller <djm at mindrot.org>
Date:   Mon Oct 17 09:41:47 2022 +1100

    revert c64b62338b4 and guard POLL* defines instead
    
    c64b62338b4 broke OSX builds, which do have poll.h but lack ppoll(2)
    Spotted by dtucker
---
 openbsd-compat/bsd-poll.h | 29 +++++++++++++++++++++--------
 1 file changed, 21 insertions(+), 8 deletions(-)

diff --git a/openbsd-compat/bsd-poll.h b/openbsd-compat/bsd-poll.h
index db365af2..ae865a6e 100644
--- a/openbsd-compat/bsd-poll.h
+++ b/openbsd-compat/bsd-poll.h
@@ -35,7 +35,7 @@
 # include <poll.h>
 #elif HAVE_SYS_POLL_H
 # include <sys/poll.h>
-#else
+#endif
 
 #ifndef HAVE_STRUCT_POLLFD_FD
 typedef struct pollfd {
@@ -44,12 +44,25 @@ typedef struct pollfd {
 	short	revents;
 } pollfd_t;
 
-#define	POLLIN		0x0001
-#define	POLLPRI		0x0002
-#define	POLLOUT		0x0004
-#define	POLLERR		0x0008
-#define	POLLHUP		0x0010
-#define	POLLNVAL	0x0020
+#ifndef POLLIN
+# define POLLIN		0x0001
+#endif
+#ifndef POLLPRI
+# define POLLPRI	0x0002
+#endif
+#ifndef POLLOUT
+# define POLLOUT	0x0004
+#endif
+#ifndef POLLERR
+# define POLLERR	0x0008
+#endif
+#ifndef POLLHUP
+# define POLLHUP	0x0010
+#endif
+#ifndef POLLNVAL
+# define POLLNVAL	0x0020
+#endif
+
 #if 0
 /* the following are currently not implemented */
 #define	POLLRDNORM	0x0040
@@ -73,5 +86,5 @@ int   poll(struct pollfd *, nfds_t, int);
 #ifndef HAVE_PPOLL
 int   ppoll(struct pollfd *, nfds_t, const struct timespec *, const sigset_t *);
 #endif
-#endif /* !HAVE_POLL_H && !HAVE_SYS_POLL_H */
+
 #endif /* !_COMPAT_POLL_H_ */

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list