diff options
author | Radostin Stoyanov <rstoyanov@fedoraproject.org> | 2022-02-04 23:41:07 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-04-29 03:53:52 +0300 |
commit | 7177938e60b81752a44a8116b3e7e399c24c4fcb (patch) | |
tree | 93bf9a04b087b9a276cc3a3003c97b4560d34fe5 /scripts | |
parent | bb1b1681abd5b48b2252066556da6b608914a450 (diff) |
criu-ns: use os.waitstatus_to_exitcode()
os.WEXITSTATUS() returns the process exit status and it should be used
only if WIFEXITED() is true, i.e., the process terminated normally.
os.waitstatus_to_exitcode() does the same as os.WEXITSTATUS() but it
also handles the case when the process has been terminated by a signal.
Suggested-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/criu-ns | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/criu-ns b/scripts/criu-ns index 6aa618218..930d20c80 100755 --- a/scripts/criu-ns +++ b/scripts/criu-ns @@ -68,7 +68,7 @@ def _wait_for_process_status(criu_pid): try: (pid, status) = os.wait() if pid == criu_pid: - return os.WEXITSTATUS(status) + return os.waitstatus_to_exitcode(status) except OSError: return -251 |