From 20268e0c3e2bbba4160e444f23be83da4542e0f5 Mon Sep 17 00:00:00 2001 From: Benjamin Robin Date: Mon, 29 Feb 2016 10:36:11 +0100 Subject: stdio-bridge: Correctly propagate error Return EXIT_FAILURE and print the correct errno code if sd_bus_get_fd() or sd_bus_get_events() fail --- src/stdio-bridge/stdio-bridge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c index 85b99ce161..ce8efce3d5 100644 --- a/src/stdio-bridge/stdio-bridge.c +++ b/src/stdio-bridge/stdio-bridge.c @@ -234,12 +234,14 @@ int main(int argc, char *argv[]) { fd = sd_bus_get_fd(a); if (fd < 0) { + r = fd; log_error_errno(r, "Failed to get fd: %m"); goto finish; } events_a = sd_bus_get_events(a); if (events_a < 0) { + r = events_a; log_error_errno(r, "Failed to get events mask: %m"); goto finish; } @@ -252,6 +254,7 @@ int main(int argc, char *argv[]) { events_b = sd_bus_get_events(b); if (events_b < 0) { + r = events_b; log_error_errno(r, "Failed to get events mask: %m"); goto finish; } -- cgit v1.2.3-54-g00ecf