aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/iomgr/endpoint_pair_posix.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-09-22 12:33:20 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-09-22 12:33:20 -0700
commita82950e68318a6aab6fe894fa39f7fa616c4647b (patch)
tree7d02bd1e9e1cbae1f14ad4ad1e06d3ae81a96dfe /src/core/iomgr/endpoint_pair_posix.c
parent8af4c337181322cc4fb396199c90f574cfb4163f (diff)
clang-format all core files
Diffstat (limited to 'src/core/iomgr/endpoint_pair_posix.c')
-rw-r--r--src/core/iomgr/endpoint_pair_posix.c35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/core/iomgr/endpoint_pair_posix.c b/src/core/iomgr/endpoint_pair_posix.c
index 5a810fb010..deae9c6875 100644
--- a/src/core/iomgr/endpoint_pair_posix.c
+++ b/src/core/iomgr/endpoint_pair_posix.c
@@ -49,31 +49,30 @@
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
-static void
-create_sockets (int sv[2])
-{
+static void create_sockets(int sv[2]) {
int flags;
- GPR_ASSERT (socketpair (AF_UNIX, SOCK_STREAM, 0, sv) == 0);
- flags = fcntl (sv[0], F_GETFL, 0);
- GPR_ASSERT (fcntl (sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
- flags = fcntl (sv[1], F_GETFL, 0);
- GPR_ASSERT (fcntl (sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
+ GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
+ flags = fcntl(sv[0], F_GETFL, 0);
+ GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
+ flags = fcntl(sv[1], F_GETFL, 0);
+ GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
}
-grpc_endpoint_pair
-grpc_iomgr_create_endpoint_pair (const char *name, size_t read_slice_size)
-{
+grpc_endpoint_pair grpc_iomgr_create_endpoint_pair(const char *name,
+ size_t read_slice_size) {
int sv[2];
grpc_endpoint_pair p;
char *final_name;
- create_sockets (sv);
+ create_sockets(sv);
- gpr_asprintf (&final_name, "%s:client", name);
- p.client = grpc_tcp_create (grpc_fd_create (sv[1], final_name), read_slice_size, "socketpair-server");
- gpr_free (final_name);
- gpr_asprintf (&final_name, "%s:server", name);
- p.server = grpc_tcp_create (grpc_fd_create (sv[0], final_name), read_slice_size, "socketpair-client");
- gpr_free (final_name);
+ gpr_asprintf(&final_name, "%s:client", name);
+ p.client = grpc_tcp_create(grpc_fd_create(sv[1], final_name), read_slice_size,
+ "socketpair-server");
+ gpr_free(final_name);
+ gpr_asprintf(&final_name, "%s:server", name);
+ p.server = grpc_tcp_create(grpc_fd_create(sv[0], final_name), read_slice_size,
+ "socketpair-client");
+ gpr_free(final_name);
return p;
}