Stop interrupt thread before destroying the enclave when error
This commit is contained in:
parent
f704604e36
commit
5d75584e32
@ -161,7 +161,7 @@ int occlum_pal_exec(struct occlum_pal_exec_args *args);
|
|||||||
int occlum_pal_kill(int pid, int sig);
|
int occlum_pal_kill(int pid, int sig);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Destroy teh Occlum enclave
|
* @brief Destroy the Occlum enclave
|
||||||
*
|
*
|
||||||
* @retval if 0, then success; otherwise, check errno for the exact error type.
|
* @retval if 0, then success; otherwise, check errno for the exact error type.
|
||||||
*/
|
*/
|
||||||
|
@ -148,10 +148,15 @@ int occlum_pal_init(const struct occlum_pal_attr *attr) {
|
|||||||
|
|
||||||
if (pal_run_init_process() < 0) {
|
if (pal_run_init_process() < 0) {
|
||||||
PAL_ERROR("Failed to run the init process: %s", errno2str(errno));
|
PAL_ERROR("Failed to run the init process: %s", errno2str(errno));
|
||||||
goto on_destroy_enclave;
|
goto stop_interrupt_thread;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
stop_interrupt_thread:
|
||||||
|
if (pal_interrupt_thread_stop() < 0) {
|
||||||
|
PAL_WARN("Cannot stop the interrupt thread: %s", errno2str(errno));
|
||||||
|
}
|
||||||
on_destroy_enclave:
|
on_destroy_enclave:
|
||||||
if (pal_destroy_enclave() < 0) {
|
if (pal_destroy_enclave() < 0) {
|
||||||
PAL_WARN("Cannot destroy the enclave");
|
PAL_WARN("Cannot destroy the enclave");
|
||||||
|
Loading…
Reference in New Issue
Block a user