1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-11 05:17:44 +03:00

Merge pull request #20486 from DaanDeMeyer/sd-bus-eproto

sd-bus: Return detailed (sd-buscntr) error from bus_container_connect_socket().
This commit is contained in:
Luca Boccassi 2021-08-19 23:32:34 +01:00 committed by GitHub
commit a622c58993
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,8 +75,7 @@ int bus_container_connect_socket(sd_bus *b) {
r = wait_for_terminate_and_check("(sd-buscntrns)", child, 0); r = wait_for_terminate_and_check("(sd-buscntrns)", child, 0);
if (r < 0) if (r < 0)
return r; return r;
if (r != EXIT_SUCCESS) bool nonzero_exit_status = r != EXIT_SUCCESS;
return -EPROTO;
n = read(pair[0], &error_buf, sizeof(error_buf)); n = read(pair[0], &error_buf, sizeof(error_buf));
if (n < 0) if (n < 0)
@ -95,8 +94,11 @@ int bus_container_connect_socket(sd_bus *b) {
return 1; return 1;
if (error_buf > 0) if (error_buf > 0)
return log_debug_errno(error_buf, "Got error from (sd-buscntr): %m"); return log_debug_errno(error_buf, "(sd-buscntr) failed to connect to D-Bus socket: %m");
} }
if (nonzero_exit_status)
return -EPROTO;
return bus_socket_start_auth(b); return bus_socket_start_auth(b);
} }