move stuff in common, clang-format, update copyright

This commit is contained in:
Guillaume Meunier
2022-11-13 11:00:04 +01:00
parent 294c4f81ba
commit 4baf2b17eb
62 changed files with 2291 additions and 2846 deletions
+2 -3
View File
@@ -2,14 +2,13 @@
#include <systemd/sd-bus.h>
std::string
hostname()
std::string hostname()
{
sd_bus * bus;
if (sd_bus_default_system(&bus) < 0)
return "";
for(auto property: {"PrettyHostname", "StaticHostname", "Hostname"})
for (auto property: {"PrettyHostname", "StaticHostname", "Hostname"})
{
char * hostname = nullptr;
sd_bus_error error = SD_BUS_ERROR_NULL;