From 95f36a3e700bde373fbd88da899c959fe43180aa Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Wed, 15 Nov 2023 18:24:27 +0100 Subject: [PATCH] No need for termination handler --- cpp/scsiexec/scsisexec_core.cpp | 22 ---------------------- cpp/scsiexec/scsisexec_core.h | 1 - 2 files changed, 23 deletions(-) diff --git a/cpp/scsiexec/scsisexec_core.cpp b/cpp/scsiexec/scsisexec_core.cpp index 537416ab..dbee0104 100644 --- a/cpp/scsiexec/scsisexec_core.cpp +++ b/cpp/scsiexec/scsisexec_core.cpp @@ -14,15 +14,12 @@ #include "shared/piscsi_util.h" #include #include -#include -#include #include #include using namespace std; using namespace filesystem; using namespace spdlog; -using namespace scsi_defs; using namespace piscsi_util; void ScsiExec::CleanUp() const @@ -32,15 +29,6 @@ void ScsiExec::CleanUp() const } } -void ScsiExec::TerminationHandler(int) -{ - instance->bus->SetRST(true); - - instance->CleanUp(); - - // Process will terminate automatically -} - bool ScsiExec::Banner(span args) const { cout << piscsi_util::Banner("(SCSI Action Execution Tool)"); @@ -62,16 +50,6 @@ bool ScsiExec::Banner(span args) const bool ScsiExec::Init(bool) { - instance = this; - // Signal handler for cleaning up - struct sigaction termination_handler; - termination_handler.sa_handler = TerminationHandler; - sigemptyset(&termination_handler.sa_mask); - termination_handler.sa_flags = 0; - sigaction(SIGINT, &termination_handler, nullptr); - sigaction(SIGTERM, &termination_handler, nullptr); - signal(SIGPIPE, SIG_IGN); - bus = GPIOBUS_Factory::Create(BUS::mode_e::INITIATOR); if (bus != nullptr) { diff --git a/cpp/scsiexec/scsisexec_core.h b/cpp/scsiexec/scsisexec_core.h index 8024f3e2..cee370fa 100644 --- a/cpp/scsiexec/scsisexec_core.h +++ b/cpp/scsiexec/scsisexec_core.h @@ -40,7 +40,6 @@ private: void Reset() const; void CleanUp() const; - static void TerminationHandler(int); unique_ptr bus;