From c25e93fee3b2d0b465aaeb2af15044d3458e16d6 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 29 Oct 2022 17:44:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=90=AF=E5=8A=A8ffmpeg?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E5=AF=BC=E8=87=B4shell=E7=BB=88=E7=AB=AF?= =?UTF-8?q?=E5=81=87=E6=AD=BB=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9A#1662?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/Process.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/Process.cpp b/server/Process.cpp index e8f48b26..7ddebb08 100644 --- a/server/Process.cpp +++ b/server/Process.cpp @@ -58,6 +58,12 @@ static int runChildProcess(string cmd, string log_file) { log_file = StrPrinter << log_file << "." << getpid(); } + if (isatty(STDIN_FILENO)) { + /* bb_error_msg("ignoring input"); */ + close(STDIN_FILENO); + open("/dev/null", O_RDONLY, 0666); /* will be fd 0 (STDIN_FILENO) */ + } + //重定向shell日志至文件 auto fp = File::create_file(log_file.data(), "ab"); if (!fp) {