From 5c71e3e028ebc7669ad0e00bc8fbbb4e41c7a5b9 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 1 Jan 2019 23:06:41 -0800 Subject: [PATCH] test/inhfd: redirect stdin to /dev/null Signed-off-by: Andrei Vagin --- test/zdtm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/zdtm.py b/test/zdtm.py index 9b88cee11..5e19d9a90 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])