1
0
forked from drath/libratbag

tools: ratbagctl: check ratbagd for immediate exit before continuing

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2017-07-24 11:14:28 +10:00
committed by Benjamin Tissoires
parent 760c3f3ff9
commit 0e26b6e2be
2 changed files with 8 additions and 1 deletions

View File

@@ -688,7 +688,7 @@ exit:
if (r < 0) {
errno = -r;
log_error("Failed: %m\n");
log_error("Failed to start ratbagd: %m\n");
return EXIT_FAILURE;
}

View File

@@ -503,6 +503,13 @@ def setUpModule():
ratbagd = ratbagctl.open_ratbagd()
assert ratbagd is not None
# if some old version of ratbagd is still running, ratbagd_process may
# have never started but our DBus bindings may succeed. Check for the
# return code here, this also gives ratbagd enough time to start and
# die. If we check immediately we may not have terminated yet.
ratbagd_process.poll()
assert ratbagd_process.returncode is None
parser = ratbagctl.get_parser()