Fix building with select (not poll) when fd_set is not defined in sys/types.h.

We can use a void * for the fd_set arrays and just add a cast when
using the FD_SET macros.
This commit is contained in:
Todd C. Miller
2022-06-06 19:42:29 -06:00
parent c2a131714a
commit b77cbb2e67
2 changed files with 12 additions and 12 deletions

View File

@@ -102,10 +102,10 @@ struct sudo_event_base {
int pfd_high; /* highest slot used */
int pfd_free; /* idx of next free entry or pfd_max if full */
#else
fd_set *readfds_in; /* read I/O descriptor set (in) */
fd_set *writefds_in; /* write I/O descriptor set (in) */
fd_set *readfds_out; /* read I/O descriptor set (out) */
fd_set *writefds_out; /* write I/O descriptor set (out) */
void *readfds_in; /* read I/O descriptor set (in) */
void *writefds_in; /* write I/O descriptor set (in) */
void *readfds_out; /* read I/O descriptor set (out) */
void *writefds_out; /* write I/O descriptor set (out) */
int maxfd; /* max fd we can store in readfds/writefds */
int highfd; /* highest fd to pass as 1st arg to select */
#endif /* HAVE_POLL */