bus-unit-util: fix bus_wait_for_jobs() debug output (#8760)

We shouldn't print 'errno' if its not initialized properly.
This commit is contained in:
Lennart Poettering 2018-04-23 02:24:43 +02:00 committed by Yu Watanabe
parent 4f4ef6a099
commit d6b87637c5

View file

@ -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));
}