From 5c35008ea1108f84e51071cc12b2a2ae0b7f3d98 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 13 Jan 2015 17:26:27 -0800 Subject: [PATCH] Unify signal handling in C --- test/core/iomgr/tcp_posix_test.c | 3 --- test/core/transport/chttp2_transport_end2end_test.c | 3 --- test/core/util/test_config.c | 3 +++ 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/test/core/iomgr/tcp_posix_test.c b/test/core/iomgr/tcp_posix_test.c index 7fd2567cec5..6af3ded98b0 100644 --- a/test/core/iomgr/tcp_posix_test.c +++ b/test/core/iomgr/tcp_posix_test.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -491,8 +490,6 @@ static grpc_endpoint_test_config configs[] = { int main(int argc, char **argv) { grpc_test_init(argc, argv); grpc_iomgr_init(); - /* disable SIGPIPE */ - signal(SIGPIPE, SIG_IGN); run_tests(); grpc_endpoint_tests(configs[0]); grpc_iomgr_shutdown(); diff --git a/test/core/transport/chttp2_transport_end2end_test.c b/test/core/transport/chttp2_transport_end2end_test.c index 30d2a174401..8b0f9aa25b5 100644 --- a/test/core/transport/chttp2_transport_end2end_test.c +++ b/test/core/transport/chttp2_transport_end2end_test.c @@ -107,9 +107,6 @@ grpc_transport_test_config fixture_configs[] = { int main(int argc, char **argv) { size_t i; - /* disable SIGPIPE */ - signal(SIGPIPE, SIG_IGN); - grpc_test_init(argc, argv); grpc_iomgr_init(); diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index fc5de9bbefb..1a8f1a5f496 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -34,9 +34,12 @@ #include "test/core/util/test_config.h" #include +#include #include void grpc_test_init(int argc, char **argv) { + /* disable SIGPIPE */ + signal(SIGPIPE, SIG_IGN); /* seed rng with pid, so we don't end up with the same random numbers as a concurrently running test binary */ srand(getpid());