[CRIU] [PATCH 4/5] test/inhfd: redirect stdin to /dev/null

Andrei Vagin avagin at gmail.com
Wed Jan 2 10:06:41 MSK 2019


Signed-off-by: Andrei Vagin <avagin at gmail.com>
---
 test/zdtm.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/test/zdtm.py b/test/zdtm.py
index 5fe8aafc1..44961485b 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -622,7 +622,9 @@ class inhfd_test:
 			fd = os.open(self.__name + ".out", os.O_WRONLY | os.O_APPEND | os.O_CREAT)
 			os.dup2(fd, 1)
 			os.dup2(fd, 2)
-			os.close(0)
+			os.close(fd)
+			fd = os.open("/dev/null", os.O_RDONLY)
+			os.dup2(fd, 0)
 			for my_file, _ in self.__files:
 				my_file.close()
 			os.close(start_pipe[0])
-- 
2.17.2



More information about the CRIU mailing list