From caed8a55c7a5ac2754641769e1f603482886d5f1 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sat, 22 Apr 2017 09:39:00 +0100 Subject: [PATCH] Set stdin to /dev/null instead of closing it when we dont have data to pipe to child Fixes #1330 Fixes #1331 --- src/shell_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell_manager.cc b/src/shell_manager.cc index 9404f97a..fff042cc 100644 --- a/src/shell_manager.cc +++ b/src/shell_manager.cc @@ -172,7 +172,7 @@ std::pair ShellManager::eval( move(child_stdin.read_fd(), 0); } else - close(0); + move(open("/dev/null", O_RDONLY), 0); close(child_stdout.read_fd()); move(child_stdout.write_fd(), 1);