commit 54c25abe602eba7b6acf89b8aba60b9df3b45026
parent 4afe8c703ff414c6daa6ba1b062864b3a2e837c3
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Thu, 16 Dec 2021 14:06:24 +0000
Fix syntax error and imports
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sbin/pidns_run b/sbin/pidns_run
@@ -4,6 +4,8 @@ import os
import os.path
import ctypes
import fcntl
+import select
+import errno
libc = ctypes.CDLL(None, use_errno=True)
CLONE_NEWPID = 0x20000000
@@ -22,15 +24,15 @@ def exit_status(status):
ret = status >> 8
if sig:
raise SystemExit(128 + sig)
- if ret >= 128
+ if ret >= 128:
raise SystemExit(128)
raise SystemExit(ret)
def main(argv):
(parent_rfd, parent_wfd) = os.pipe()
- nonblock_cloexec(read_fd)
- nonblock_cloexec(write_fd)
+ nonblock_cloexec(parent_rfd)
+ nonblock_cloexec(parent_wfd)
if libc.unshare(CLONE_NEWPID) != 0:
raise OSError(ctypes.get_errno())
fork_pid = os.fork()