From dc5a4c50100133f1c746c861485afc18b77ceb5d Mon Sep 17 00:00:00 2001 From: joshuaboud Date: Tue, 23 Mar 2021 15:12:21 -0300 Subject: [PATCH] set status to NOT_RUNNING before exiting --- src/signal.cpp | 1 + src/signal.hpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/signal.cpp b/src/signal.cpp index f563dcb..983f4f9 100644 --- a/src/signal.cpp +++ b/src/signal.cpp @@ -34,6 +34,7 @@ void sig_hdlr(int signum){ signal_handling::crawler_->write_last_rctime(); signal_handling::crawler_->delete_snap(); } + Status::status.set(Status::NOT_RUNNING); switch(signum){ case SIGINT: case SIGTERM: diff --git a/src/signal.hpp b/src/signal.hpp index dd8543d..ba9d893 100644 --- a/src/signal.hpp +++ b/src/signal.hpp @@ -20,6 +20,7 @@ #pragma once #include "rctime.hpp" +#include "status.hpp" class Crawler; @@ -36,5 +37,5 @@ namespace signal_handling{ } namespace l{ - void exit(int num, int status = 1); + void exit(int num, int status = Status::NOT_RUNNING); }