]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-unit-util: fix bus_wait_for_jobs() debug output (#8760)
authorLennart Poettering <lennart@poettering.net>
Mon, 23 Apr 2018 00:24:43 +0000 (02:24 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 23 Apr 2018 00:24:43 +0000 (09:24 +0900)
We shouldn't print 'errno' if its not initialized properly.

src/shared/bus-unit-util.c

index 49cee2939e4717dd70c1bfc3fe02ee22b5c02bea..3cf024889995291360bef84e6b8ce5256e264679 100644 (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));
                 }