mirror of https://github.com/akuker/RASCSI.git
No need for termination handler
This commit is contained in:
parent
636311e62d
commit
95f36a3e70
|
@ -14,15 +14,12 @@
|
|||
#include "shared/piscsi_util.h"
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <filesystem>
|
||||
#include <csignal>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
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<char*> args) const
|
||||
{
|
||||
cout << piscsi_util::Banner("(SCSI Action Execution Tool)");
|
||||
|
@ -62,16 +50,6 @@ bool ScsiExec::Banner(span<char*> 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) {
|
||||
|
|
|
@ -40,7 +40,6 @@ private:
|
|||
void Reset() const;
|
||||
|
||||
void CleanUp() const;
|
||||
static void TerminationHandler(int);
|
||||
|
||||
unique_ptr<BUS> bus;
|
||||
|
||||
|
|
Loading…
Reference in New Issue