Commit 67c2160c authored by Ramon Nou's avatar Ramon Nou
Browse files

Missing waitpid return value check

parent 92278242
Loading
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -502,12 +502,19 @@ ADM_deploy_adhoc_storage(hg_handle_t h) {
                }
                default: {
                    int wstatus = 0;
                    waitpid(pid, &wstatus, 0);
                    pid_t retwait = waitpid(pid, &wstatus, 0);
                    if(retwait == -1) {
                        LOGGER_ERROR(
                                "rpc id: {} error_msg: \"Error waitpid code: {}\"",
                                rpc_id, retwait);
                        ec = admire::error_code::other;
                    } else {
                        if(WEXITSTATUS(wstatus) != 0) {
                            ec = admire::error_code::other;
                        } else {
                            ec = admire::error_code::success;
                        }
                    }
                    break;
                }
            }