From d8acf94a02d17b939ac7e92457d61f878299f9f4 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 29 Jul 2021 18:33:15 +0200 Subject: [PATCH] more corrections --- watchdog/Watchdog.cpp | 1 + watchdog/main.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/watchdog/Watchdog.cpp b/watchdog/Watchdog.cpp index f3627a75..9ae60548 100644 --- a/watchdog/Watchdog.cpp +++ b/watchdog/Watchdog.cpp @@ -45,6 +45,7 @@ int WatchdogTask::performOperation() { if(fd < 0) { std::cerr << "eive-watchdog: Opening pipe " << watchdog::FIFO_NAME << "read-only failed with " << errno << ": " << strerror(errno) << std::endl; + return -1; } state = States::RUNNING; diff --git a/watchdog/main.cpp b/watchdog/main.cpp index f297f429..ba75dc30 100644 --- a/watchdog/main.cpp +++ b/watchdog/main.cpp @@ -10,7 +10,10 @@ int main() { std::cout << "eive-watchdog: Starting OBSW watchdog.." << std::endl; try { WatchdogTask watchdogTask; - watchdogTask.performOperation(); + int result = watchdogTask.performOperation(); + if(result != 0) { + return result; + } } catch(const std::runtime_error& e) { std::cerr << "eive-watchdog: Run time exception " << e.what() << std::endl;