Fix platform detection

pull/7664/head
Ken Payson 8 years ago
parent 5b5c8071c6
commit bc544be002
  1. 4
      src/core/lib/iomgr/ev_epoll_linux.c
  2. 3
      src/core/lib/iomgr/ev_poll_posix.c
  3. 1
      src/core/lib/iomgr/ev_posix.c
  4. 3
      src/core/lib/iomgr/wakeup_fd_pipe.c

@ -1892,6 +1892,10 @@ const grpc_event_engine_vtable *grpc_init_epoll_linux(void) {
return NULL;
}
if (!grpc_has_wakeup_fd) {
return NULL;
}
if (!is_epoll_available()) {
return NULL;
}

@ -1277,6 +1277,9 @@ static const grpc_event_engine_vtable vtable = {
};
const grpc_event_engine_vtable *grpc_init_poll_posix(void) {
if (!grpc_has_wakeup_fd) {
return NULL;
}
if (!GRPC_LOG_IF_ERROR("pollset_global_init", pollset_global_init())) {
return NULL;
}

@ -65,6 +65,7 @@ typedef struct {
} event_engine_factory;
static const event_engine_factory g_factories[] = {
{"poll-cv", grpc_init_poll_cv_posix},
{"epoll", grpc_init_epoll_linux},
{"poll", grpc_init_poll_posix},
{"poll-cv", grpc_init_poll_cv_posix},

@ -47,11 +47,10 @@
static grpc_error* pipe_init(grpc_wakeup_fd* fd_info) {
int pipefd[2];
/* TODO(klempner): Make this nonfatal */
int r = pipe(pipefd);
if (0 != r) {
gpr_log(GPR_ERROR, "pipe creation failed (%d): %s", errno, strerror(errno));
abort();
return GRPC_OS_ERROR(errno, "pipe");
}
grpc_error* err;
err = grpc_set_socket_nonblocking(pipefd[0], 1);

Loading…
Cancel
Save