From 5f089e54e0c4172645a359eae98f433ffa69d8b5 Mon Sep 17 00:00:00 2001 From: Eran Date: Thu, 2 Jan 2025 21:36:13 +0200 Subject: [PATCH] cin test --- tools/dds/dds-adapter/rs-dds-adapter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/dds/dds-adapter/rs-dds-adapter.cpp b/tools/dds/dds-adapter/rs-dds-adapter.cpp index 30e43efc4a..9a55c52122 100644 --- a/tools/dds/dds-adapter/rs-dds-adapter.cpp +++ b/tools/dds/dds-adapter/rs-dds-adapter.cpp @@ -195,7 +195,13 @@ try device_handlers_list.erase( dev ); } ); - std::cin.ignore(std::numeric_limits::max(), 0);// Pend until CTRL + C is pressed + if( ! std::cin.good() ) + { + std::cout << "No CIN..." << std::endl; + std::this_thread::sleep_for( std::chrono::seconds( 120 ) ); + } + else + std::cin.ignore(std::numeric_limits::max(), 0);// Pend until CTRL + C is pressed std::cout << "Shutting down rs-dds-adapter..." << std::endl;