diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index 378151c5711..b6830cc0557 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -71,6 +71,8 @@ using namespace gflags; static bool got_sigint = false; +static void sigint_handler(int x) {got_sigint = true;} + namespace grpc { namespace testing { @@ -248,6 +250,8 @@ int main(int argc, char** argv) { grpc_init(); ParseCommandLineFlags(&argc, &argv, true); + signal(SIGINT, sigint_handler); + grpc::testing::RunServer(); grpc_shutdown();