Skip to content
Snippets Groups Projects
Commit 67c2160c authored by Ramon Nou's avatar Ramon Nou
Browse files

Missing waitpid return value check

parent 92278242
No related branches found
No related tags found
1 merge request!40Resolve "Refactor library RPC implementation of `admire::deploy_adhoc_storage`"
Pipeline #3374 passed
...@@ -502,11 +502,18 @@ ADM_deploy_adhoc_storage(hg_handle_t h) { ...@@ -502,11 +502,18 @@ ADM_deploy_adhoc_storage(hg_handle_t h) {
} }
default: { default: {
int wstatus = 0; int wstatus = 0;
waitpid(pid, &wstatus, 0); pid_t retwait = waitpid(pid, &wstatus, 0);
if(WEXITSTATUS(wstatus) != 0) { if(retwait == -1) {
LOGGER_ERROR(
"rpc id: {} error_msg: \"Error waitpid code: {}\"",
rpc_id, retwait);
ec = admire::error_code::other; ec = admire::error_code::other;
} else { } else {
ec = admire::error_code::success; if(WEXITSTATUS(wstatus) != 0) {
ec = admire::error_code::other;
} else {
ec = admire::error_code::success;
}
} }
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment