1
0
forked from drath/libratbag

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 <benjamin.tissoires@gmail.com>
This commit is contained in:
Benjamin Tissoires
2017-09-04 11:13:39 +02:00
committed by Peter Hutterer
parent c31e11d385
commit 7cd2cfed44

View File

@@ -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: