]> git.ipfire.org Git - telemetry.git/commitdiff
bus: Log if we cannot connect to dbus
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Feb 2026 17:01:51 +0000 (17:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 24 Feb 2026 17:01:51 +0000 (17:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/bus.c

index 26b77ff0742879a66ccc64681c541d235dcd605a..907c967d97fbc85004e40a8ea6282758d6649b02 100644 (file)
 static int td_bus_on_connect(sd_bus_message* m, void* data, sd_bus_error* error) {
        td_ctx* ctx = data;
 
+       // Show the error if set
+       if (sd_bus_error_is_set(error)) {
+               ERROR(ctx, "Failed to connect to D-Bus: %s\n", error->name);
+
+               // Pass on the error
+               return sd_bus_error_get_errno(error);
+       }
+
        // Log action
        DEBUG(ctx, "Connected to D-Bus\n");