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

Submitted by Andrei Vagin on Jan. 2, 2019, 7:06 a.m.

Details

Message ID 20190102070642.27270-5-avagin@gmail.com
State Accepted
Series "travix: a few fixes for docker and fedora jobs"
Headers show

Commit Message

Andrei Vagin Jan. 2, 2019, 7:06 a.m.
Signed-off-by: Andrei Vagin <avagin@gmail.com>
---
 test/zdtm.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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])