avoid exceptions
This commit is contained in:
@ -37,9 +37,10 @@ int obsw::obsw(int argc, char* argv[]) {
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
#if Q7S_CHECK_FOR_ALREADY_RUNNING_IMG == 1
|
||||
std::error_code e;
|
||||
// Check special file here. This file is created or deleted by the eive-watchdog application
|
||||
// or systemd service!
|
||||
if (std::filesystem::exists(watchdog::RUNNING_FILE_NAME)) {
|
||||
if (std::filesystem::exists(watchdog::RUNNING_FILE_NAME, e)) {
|
||||
sif::warning << "File " << watchdog::RUNNING_FILE_NAME
|
||||
<< " exists so the software might "
|
||||
"already be running. Check if obsw systemd service has been stopped."
|
||||
@ -84,8 +85,9 @@ void obsw::bootDelayHandling() {
|
||||
homedir = getpwuid(getuid())->pw_dir;
|
||||
}
|
||||
std::filesystem::path bootDelayFile = std::filesystem::path(homedir) / "boot_delay_secs.txt";
|
||||
std::error_code e;
|
||||
// Init delay handling.
|
||||
if (std::filesystem::exists(bootDelayFile)) {
|
||||
if (std::filesystem::exists(bootDelayFile, e)) {
|
||||
std::ifstream ifile(bootDelayFile);
|
||||
std::string lineStr;
|
||||
unsigned int bootDelaySecs = 0;
|
||||
|
Reference in New Issue
Block a user