FFmpeg禁止生产core文件

This commit is contained in:
xiongziliang
2019-06-24 14:50:50 +08:00
parent e26056617b
commit 276aa1a497
2 changed files with 43 additions and 0 deletions

View File

@@ -44,6 +44,11 @@ void Process::run(const string &cmd, const string &log_file_tmp) {
}
if (_pid == 0) {
//子进程
//子进程关闭core文件生成
struct rlimit rlim = {0,0};
setrlimit(RLIMIT_CORE, &rlim);
// ignore the SIGINT and SIGTERM
signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);