Clean shutdown, stability
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user