解决linux下升级结果返回不正确的问题

This commit is contained in:
luoliangyi 2022-07-22 15:11:15 +08:00
parent b315b0dba5
commit 3442c966b0
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ bool MainWindow::Upgrade(const std::string& pkgPath)
#else
std::string cmd = "pkexec dpkg -i \"" + pkgPath + "\"";
if (0 == system(cmd.c_str()))
int status = system(cmd.c_str());
if (-1 != status && WIFEXITED(status) && 0 == WEXITSTATUS(status))
ret = true;
#endif