mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
test/ext-tty: return an error if a child isn't killed by SIGHUP
Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
d55a1fdd31
commit
aa40501d95
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
import subprocess
|
||||
import pty
|
||||
import os, sys, time
|
||||
import os, sys, time, signal, pty
|
||||
|
||||
master, slave = pty.openpty()
|
||||
|
||||
@@ -29,7 +29,7 @@ os.waitpid(-1, os.WNOHANG) # is the process alive
|
||||
|
||||
os.close(new_master)
|
||||
_, status = os.wait()
|
||||
if not os.WIFSIGNALED(status) or not os.WTERMSIG(status):
|
||||
if not os.WIFSIGNALED(status) or os.WTERMSIG(status) != signal.SIGHUP:
|
||||
print status
|
||||
sys.exit(1)
|
||||
|
||||
|
Reference in New Issue
Block a user