revert c64b62338b and guard POLL* defines instead

c64b62338b broke OSX builds, which do have poll.h but lack ppoll(2)
Spotted by dtucker
This commit is contained in:
Damien Miller 2022-10-17 09:41:47 +11:00
parent bc2e480d99
commit 195e5a65fd
No known key found for this signature in database
1 changed files with 21 additions and 8 deletions

View File

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