chiark / gitweb /
systemctl: fix and refactor wait_for_jobs
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 7 Dec 2013 20:53:37 +0000 (21:53 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 7 Dec 2013 21:39:46 +0000 (22:39 +0100)
commit4c49ab0e7a7f9f14f4308476257cd3548d0b4694
tree97461154a8718b8d0260e724e91449a15c8afbdd
parentd8fba7c6ccea5e60f31f329f481fb2cdf6907ce9
systemctl: fix and refactor wait_for_jobs

wait_for_jobs was ignoring the errors from the jobs stored in r.
It would only ever return whether the call to sd_bus_remove_filter
went ok. This patch changes it to return the first job related error
encountered. If a job related error is found, then the result of the
call to sd_bus_remove_filter is ignored.

wait_for_jobs was a bit hard to read so I split it up to avoid
the goto and deep nesting.
src/systemctl/systemctl.c