From d6b87637c52148f5861aca557de2711dcd0c2efd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 23 Apr 2018 02:24:43 +0200 Subject: [PATCH] bus-unit-util: fix bus_wait_for_jobs() debug output (#8760) We shouldn't print 'errno' if its not initialized properly. --- src/shared/bus-unit-util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 49cee2939e..3cf0248899 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -1971,6 +1971,8 @@ int bus_wait_for_jobs(BusWaitForJobs *d, bool quiet, const char* const* extra_ar if (q < 0 && r == 0) r = q; + errno = 0; /* Reset errno explicitly, so that log_debug_errno() will properly print 'Success' + * for q == 0, instead of whatever is set in errno */ log_debug_errno(q, "Got result %s/%m for job %s", strna(d->result), strna(d->name)); } -- 2.25.1