Clean shutdown, stability

This commit is contained in:
Robin Davies
2024-09-21 13:18:00 -04:00
parent 951a7a73de
commit 2b13dc1c96
30 changed files with 820 additions and 358 deletions
+2
View File
@@ -6,6 +6,7 @@
#include "ss.hpp"
#include <chrono>
#include <cassert>
#include "util.hpp"
DBusDispatcher::DBusDispatcher(bool systemBus)
{
@@ -87,6 +88,7 @@ void DBusDispatcher::WakeThread()
}
void DBusDispatcher::ThreadProc()
{
pipedal::SetThreadName("dbusd");
try
{
+1 -11
View File
@@ -30,7 +30,7 @@
#include <sdbus-c++/sdbus-c++.h>
#include <iostream>
#include <memory>
#include <unistd.h> // for gethostname()
#include "util.hpp"
using namespace pipedal;
using namespace std;
@@ -89,16 +89,6 @@ bool WifiConfigSettings::ValidateCountryCode(const std::string &text)
return std::isalpha(text[0]) && std::isalpha(text[1]);
}
static std::string GetHostName()
{
char buffer[1024];
if (gethostname(buffer,1024) != 0)
{
buffer[0] = '\0';
}
buffer[1023] = '\0';
return buffer;
}
void WifiConfigSettings::Load()
{
+1 -1
View File
@@ -150,7 +150,7 @@ namespace pipedal
static void error(const char *format, ...)
{
if (Lv2Log::log_level_ >= LogLevel::Warning)
if (Lv2Log::log_level_ >= LogLevel::Error)
{
va_list arglist;
va_start(arglist, format);
+3
View File
@@ -35,4 +35,7 @@ namespace pipedal {
std::u32string ToUtf32(const std::string &s);
inline bool isPathSeperator(char c) { return c == '/' || c == std::filesystem::path::preferred_separator;}
std::string GetHostName();
}
+12
View File
@@ -100,3 +100,15 @@ std::u32string pipedal::ToUtf32(const std::string &s)
}
return result.str();
}
std::string pipedal::GetHostName()
{
char buffer[1024];
if (gethostname(buffer,1024) != 0)
{
buffer[0] = '\0';
}
buffer[1023] = '\0';
return buffer;
}