mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-21 01:13:37 +08:00
解决启动ffmpeg进程导致shell终端假死的问题:#1662
This commit is contained in:
parent
9bb4b55924
commit
c25e93fee3
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user