Browse Source

[core] omit fdevent select() code if poll() avail

omit fdevent select() code if poll() avail
translate server.event-handler = "select" to "poll" when poll available
master
Glenn Strauss 5 months ago
parent
commit
6836a32c4f
  1. 4
      src/fdevent.c
  2. 2
      src/fdevent_impl.h

4
src/fdevent.c

@ -61,6 +61,10 @@ int fdevent_config(const char **event_handler_name, log_error_st *errh) {
if (NULL != event_handler && 0 == strcmp(event_handler, "libev"))
event_handler = NULL;
#endif
#ifdef FDEVENT_USE_POLL
if (NULL != event_handler && 0 == strcmp(event_handler, "select"))
event_handler = "poll";
#endif
if (NULL == event_handler) {
/* choose a good default

2
src/fdevent_impl.h

@ -16,6 +16,7 @@ struct epoll_event; /* declaration */
struct pollfd; /* declaration */
#endif
#ifndef FDEVENT_USE_POLL
#if defined HAVE_SELECT
# ifdef __WIN32
# include <winsock2.h>
@ -25,6 +26,7 @@ struct pollfd; /* declaration */
# include <sys/select.h>
# endif
#endif
#endif
#if defined HAVE_SYS_DEVPOLL_H && defined(__sun)
# define FDEVENT_USE_SOLARIS_DEVPOLL

Loading…
Cancel
Save