fix: 修复AM启动崩溃的问题

部分root进程在/proc文件系统查找不到exe、cwd、cmdline信息,将其过滤掉

Log:
Task: https://pms.uniontech.com/task-view-155485.html
Influence: AM正常启动
Change-Id: Ibc6fd227d0ec1505de3c1a96be1726a422a05135
This commit is contained in:
weizhixiang
2022-06-27 10:15:19 +08:00
parent dfa232bb98
commit d6a7ca131a
4 changed files with 77 additions and 47 deletions

View File

@ -40,6 +40,7 @@ public:
int getPid();
int getPpid();
bool initWithPid();
bool isValid();
std::string getExe();
std::string getOneCommandLine();
std::string getShellScriptLines();
@ -47,13 +48,14 @@ public:
private:
std::string getJoinedExeArgs();
std::vector<std::string> cmdLine;
std::vector<std::string> args;
std::string exe;
std::string cwd;
std::vector<std::string> m_cmdLine;
std::vector<std::string> m_args;
std::string m_exe;
std::string m_cwd;
bool hasPid;
Process process;
bool m_hasPid;
bool m_isValid;
Process m_process;
};
#endif // PROCESSINFO_H