Skip to content

Commit

Permalink
Merge pull request grpc#5417 from ctiller/fix_something
Browse files Browse the repository at this point in the history
Add extra error detail for pipe creation failure
  • Loading branch information
jtattermusch committed Mar 21, 2016
2 parents 9168181 + d13178a commit 795a50f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/core/iomgr/wakeup_fd_pipe.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit 795a50f

Please sign in to comment.