Merge pull request #5417 from ctiller/fix_something

Add extra error detail for pipe creation failure
pull/5907/merge
Jan Tattermusch 9 years ago
commit 795a50fc71
  1. 11
      src/core/iomgr/wakeup_fd_pipe.c

@ -1,6 +1,6 @@
/* /*
* *
* Copyright 2015, Google Inc. * Copyright 2015-2016, Google Inc.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@ -41,13 +41,18 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "src/core/iomgr/socket_utils_posix.h"
#include <grpc/support/log.h> #include <grpc/support/log.h>
#include "src/core/iomgr/socket_utils_posix.h"
static void pipe_init(grpc_wakeup_fd* fd_info) { static void pipe_init(grpc_wakeup_fd* fd_info) {
int pipefd[2]; int pipefd[2];
/* TODO(klempner): Make this nonfatal */ /* 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[0], 1));
GPR_ASSERT(grpc_set_socket_nonblocking(pipefd[1], 1)); GPR_ASSERT(grpc_set_socket_nonblocking(pipefd[1], 1));
fd_info->read_fd = pipefd[0]; fd_info->read_fd = pipefd[0];

Loading…
Cancel
Save