Skip to content

Commit

Permalink
processes: bugfix: waitpid check result
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Feb 20, 2022
1 parent be3aba3 commit 01a1afa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rpcclient/rpcclient/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def kill(self, pid: int, sig: int = SIGTERM):
def waitpid(self, pid: int):
""" waitpid(pid, sig) at remote. read man for more details. """
with self._client.safe_malloc(8) as stat_loc:
err = self._client.symbols.waitpid(pid, stat_loc, 0)
if err:
raise BadReturnValueError(f'waitpid(): returned {err}')
err = self._client.symbols.waitpid(pid, stat_loc, 0).c_int64
if err == -1:
raise BadReturnValueError(f'waitpid(): returned {err} ({self._client.last_error})')
return stat_loc[0]

0 comments on commit 01a1afa

Please sign in to comment.