aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-03-21 16:56:47 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-03-21 16:56:47 -0700
commit795a50fc7175a4abbd991cbd806718ac52c461e9 (patch)
treed02299218d6dbdace19ed041cf4d23c0fa5515dc
parent9168181755dd34e1c3c0192acadd43e5173709a7 (diff)
parentd13178a2946e34fd5a084a6d56d3335269e97e41 (diff)
Merge pull request #5417 from ctiller/fix_something
Add extra error detail for pipe creation failure
-rw-r--r--src/core/iomgr/wakeup_fd_pipe.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/iomgr/wakeup_fd_pipe.c b/src/core/iomgr/wakeup_fd_pipe.c
index 80de181d9d..dd2fd1f057 100644
--- a/src/core/iomgr/wakeup_fd_pipe.c
+++ b/src/core/iomgr/wakeup_fd_pipe.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -41,13 +41,18 @@
#include <string.h>
#include <unistd.h>
-#include "src/core/iomgr/socket_utils_posix.h"
#include <grpc/support/log.h>
+#include "src/core/iomgr/socket_utils_posix.h"
+
static void pipe_init(grpc_wakeup_fd* fd_info) {
int pipefd[2];
/* TODO(klempner): Make this nonfatal */
- GPR_ASSERT(0 == pipe(pipefd));
+ int r = pipe(pipefd);
+ if (0 != r) {
+ gpr_log(GPR_ERROR, "pipe creation failed (%d): %s", errno, strerror(errno));
+ abort();
+ }
GPR_ASSERT(grpc_set_socket_nonblocking(pipefd[0], 1));
GPR_ASSERT(grpc_set_socket_nonblocking(pipefd[1], 1));
fd_info->read_fd = pipefd[0];