mirror of
https://gitee.com/openharmony/filemanagement_storage_service
synced 2024-11-23 06:59:59 +00:00
exit 导致退出异常
Signed-off-by: s30051537 <sunxiaoqiang7@huawei.com>
This commit is contained in:
parent
f10f0adfae
commit
72fbdcba18
@ -434,12 +434,12 @@ int ForkExec(std::vector<std::string> &cmd, std::vector<std::string> *output)
|
||||
(void)close(pipe_fd[0]);
|
||||
if (dup2(pipe_fd[1], STDOUT_FILENO) == -1) {
|
||||
LOGE("dup2 failed");
|
||||
exit(1);
|
||||
_exit(1);
|
||||
}
|
||||
(void)close(pipe_fd[1]);
|
||||
execvp(args[0], const_cast<char **>(args.data()));
|
||||
LOGE("execvp failed errno: %{public}d", errno);
|
||||
exit(1);
|
||||
_exit(1);
|
||||
} else {
|
||||
(void)close(pipe_fd[1]);
|
||||
if (output) {
|
||||
@ -461,6 +461,10 @@ int ForkExec(std::vector<std::string> &cmd, std::vector<std::string> *output)
|
||||
LOGE("Process exits abnormally");
|
||||
return E_ERR;
|
||||
}
|
||||
if (!WEXITSTATUS(status)) {
|
||||
LOGE("Process exited with an error");
|
||||
return E_ERR;
|
||||
}
|
||||
}
|
||||
return E_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user