8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 04:43:03 +01:00

Fixed #7295: Unexpected message 'Error reading data from the connection' when fbtracemgr is closed using ctrl-C

(cherry picked from commit b7d42e20fa)
This commit is contained in:
AlexPeshkoff 2022-09-07 13:57:08 +03:00
parent 1c6aae776e
commit e893c09d2f

View File

@ -61,6 +61,8 @@ public:
virtual void setActive(ULONG id, bool active);
virtual void listSessions();
os_utils::CtrlCHandler ctrlCHandler;
private:
void runService(size_t spbSize, const UCHAR* spb);
@ -199,8 +201,6 @@ void TraceSvcUtil::listSessions()
void TraceSvcUtil::runService(size_t spbSize, const UCHAR* spb)
{
os_utils::CtrlCHandler ctrlCHandler;
ISC_STATUS_ARRAY status;
if (isc_service_start(status, &m_svcHandle, 0,
@ -321,20 +321,23 @@ int CLIB_ROUTINE main(int argc, char* argv[])
fb_utils::FbShutdown appShutdown(fb_shutrsn_app_stopped);
AutoPtr<UtilSvc> uSvc(UtilSvc::createStandalone(argc, argv));
TraceSvcUtil traceUtil;
try
{
TraceSvcUtil traceUtil;
fbtrace(uSvc, &traceUtil);
}
catch (const Firebird::Exception& ex)
{
Firebird::StaticStatusVector temp;
if (!traceUtil.ctrlCHandler.getTerminated())
{
Firebird::StaticStatusVector temp;
ex.stuffException(temp);
isc_print_status(temp.begin());
ex.stuffException(temp);
isc_print_status(temp.begin());
return FINI_ERROR;
return FINI_ERROR;
}
}
return FINI_OK;