Merge pull request #2284 from jbeich/dbus

This commit is contained in:
Alexis Rouillard 2023-07-05 20:17:51 +02:00 committed by GitHub
commit 423d8495e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
#include "util/prepare_for_sleep.h" #include "util/prepare_for_sleep.h"
#include <gio/gio.h> #include <gio/gio.h>
#include <spdlog/spdlog.h>
namespace { namespace {
class PrepareForSleep { class PrepareForSleep {
@ -9,7 +10,7 @@ class PrepareForSleep {
GError *error = NULL; GError *error = NULL;
login1_connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error); login1_connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (!login1_connection) { if (!login1_connection) {
throw std::runtime_error("Unable to connect to the SYSTEM Bus!..."); spdlog::warn("Unable to connect to the SYSTEM Bus!...");
} else { } else {
login1_id = g_dbus_connection_signal_subscribe( login1_id = g_dbus_connection_signal_subscribe(
login1_connection, "org.freedesktop.login1", "org.freedesktop.login1.Manager", login1_connection, "org.freedesktop.login1", "org.freedesktop.login1.Manager",