diff --git a/devlib/connection.py b/devlib/connection.py index aacb48a0f..a857a57bc 100644 --- a/devlib/connection.py +++ b/devlib/connection.py @@ -35,7 +35,7 @@ def _kill_pgid_cmd(pgid, sig, busybox): - return '{} kill -{} -- -{}'.format(busybox, sig.value, pgid) + return '{} kill -{} -{}'.format(busybox, sig.value, pgid) def _popen_communicate(bg, popen, input, timeout): try: @@ -170,7 +170,7 @@ def send_signal(self, sig): :type signal: signal.Signals """ try: - self._send_signal(signal.SIGKILL) + return self._send_signal(sig) finally: # Deregister if the command has finished self.poll() @@ -188,7 +188,7 @@ def cancel(self, kill_timeout=_KILL_TIMEOUT): """ try: if self.poll() is None: - self._cancel(kill_timeout=kill_timeout) + return self._cancel(kill_timeout=kill_timeout) finally: self._deregister() @@ -208,7 +208,7 @@ def wait(self): Block until the background command completes, and return its exit code. """ try: - self._wait() + return self._wait() finally: self._deregister()