I am working on old embedded code that uses the legacy dbus-glib library.
In legacy code, this piece of code works well:
GError* error = NULL;
DBusGConnection *systemBus = dbus_g_bus_get_private(DBUS_BUS_SYSTEM, NULL, &error);
Now I tried to get a system bus with the equivalent of GDBus:
GError* error = NULL;
GDBusConnection *systemBus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
It fails, but error->message
returns Could not connect: No such file or directory
.
Who cares?
By the way, the same call works on the session bus:
GError* error = NULL;
DBusConnection *sessionBus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
source
share