diff options
author | 2015-08-17 13:23:14 -0700 | |
---|---|---|
committer | 2015-08-17 13:23:14 -0700 | |
commit | 8f7bff7d48129e577f972815afcc9f32c78d258b (patch) | |
tree | c2f278fdefc6348a0ba2ba413b13e613115fdc8c /test/core/util/port_posix.c | |
parent | d067c263b250657891de4ad96ae51249435c6066 (diff) | |
parent | 2194cd8fd4d53a3333fbd0e7bc938e22210d23d2 (diff) |
Merge github.com:grpc/grpc into y12kdm3
Diffstat (limited to 'test/core/util/port_posix.c')
-rw-r--r-- | test/core/util/port_posix.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c index 9bff18d311..836e62a541 100644 --- a/test/core/util/port_posix.c +++ b/test/core/util/port_posix.c @@ -66,9 +66,7 @@ static int has_port_been_chosen(int port) { return 0; } -static void free_chosen_ports() { - gpr_free(chosen_ports); -} +static void free_chosen_ports() { gpr_free(chosen_ports); } static void chose_port(int port) { if (chosen_ports == NULL) { @@ -180,7 +178,7 @@ static int pick_port_using_server(char *server) { gpr_mu_lock(GRPC_POLLSET_MU(&pr.pollset)); while (pr.port == -1) { grpc_pollset_worker worker; - grpc_pollset_work(&pr.pollset, &worker, + grpc_pollset_work(&pr.pollset, &worker, gpr_now(GPR_CLOCK_MONOTONIC), GRPC_TIMEOUT_SECONDS_TO_DEADLINE(1)); } gpr_mu_unlock(GRPC_POLLSET_MU(&pr.pollset)); @@ -206,7 +204,8 @@ int grpc_pick_unused_port(void) { /* Type of port to first pick in next iteration */ int is_tcp = 1; - int try = 0; + int try + = 0; char *env = gpr_getenv("GRPC_TEST_PORT_SERVER"); if (env) { @@ -219,7 +218,8 @@ int grpc_pick_unused_port(void) { for (;;) { int port; - try++; + try + ++; if (try == 1) { port = getpid() % (65536 - 30000) + 30000; } else if (try <= NUM_RANDOM_PORTS_TO_PICK) { |