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:
committed by
Benjamin Tissoires
parent
760c3f3ff9
commit
0e26b6e2be
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user