aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/iomgr/wakeup_fd_pipe.c
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-10-19 13:53:21 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-10-19 13:53:21 -0700
commit59f347e125182a273f32907f28fa09a264763ffc (patch)
treee8f6098abdcf2f741e4833c875d71f4ff6257360 /src/core/lib/iomgr/wakeup_fd_pipe.c
parent583eb9b96f83f8e443ee530d0cc8df9c233a2de9 (diff)
parentee167049f5834950b857d4d24aafd7f0738361fb (diff)
Merge branch 'master' into uv_core_transport
Diffstat (limited to 'src/core/lib/iomgr/wakeup_fd_pipe.c')
-rw-r--r--src/core/lib/iomgr/wakeup_fd_pipe.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/lib/iomgr/wakeup_fd_pipe.c b/src/core/lib/iomgr/wakeup_fd_pipe.c
index b9754228b1..183f0eb930 100644
--- a/src/core/lib/iomgr/wakeup_fd_pipe.c
+++ b/src/core/lib/iomgr/wakeup_fd_pipe.c
@@ -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);
@@ -95,8 +94,13 @@ static void pipe_destroy(grpc_wakeup_fd* fd_info) {
}
static int pipe_check_availability(void) {
- /* Assume that pipes are always available. */
- return 1;
+ grpc_wakeup_fd fd;
+ if (pipe_init(&fd) == GRPC_ERROR_NONE) {
+ pipe_destroy(&fd);
+ return 1;
+ } else {
+ return 0;
+ }
}
const grpc_wakeup_fd_vtable grpc_pipe_wakeup_fd_vtable = {