From 7cd2cfed44690839f647fbfb8863103c3abef8df Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Mon, 4 Sep 2017 11:13:39 +0200 Subject: [PATCH] tools: ratbagctl.devel: fix commit() async call If we leave ratbagctl.devel too soon, ratbagd gets killed before it even receives the async call for commmit(), meaning everything we do on the device is lost. 0.5 is empirical. It seems on my system 0.2 is enough (0.1 doesn't seem to work). Hopefully this value is not device dependent. Signed-off-by: Benjamin Tissoires --- tools/ratbagctl.devel.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/ratbagctl.devel.in b/tools/ratbagctl.devel.in index 47e17432..be1e453f 100755 --- a/tools/ratbagctl.devel.in +++ b/tools/ratbagctl.devel.in @@ -26,6 +26,7 @@ # DEALINGS IN THE SOFTWARE. import os +import time import toolbox import signal import sys @@ -62,6 +63,9 @@ def main(argv): return else: f(ratbagd, cmd) + # give time for ratbagd to receive async requests before + # we try to terminate it + time.sleep(0.5) finally: try: if cmd.keepalive: