合并代码,去除冗余代码

This commit is contained in:
ziyue
2021-04-02 16:23:40 +08:00
8 changed files with 45 additions and 51 deletions

View File

@@ -108,10 +108,17 @@ void Process::run(const string &cmd, const string &log_file_tmp) {
}
fprintf(stderr, "\r\n\r\n#### pid=%d,cmd=%s #####\r\n\r\n", getpid(), cmd.data());
#ifndef ANDROID
//关闭父进程继承的fd
for (int i = 3; i < getdtablesize(); i++) {
::close(i);
}
#else
//关闭父进程继承的fd
for (int i = 3; i < 1024; i++) {
::close(i);
}
#endif
auto params = split(cmd, " ");
// memory leak in child process, it's ok.