Skip to content

Commit

Permalink
fixup cmb_exec_cb
Browse files Browse the repository at this point in the history
  • Loading branch information
grondo committed May 8, 2018
1 parent 0371bd1 commit 544b307
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/modules/wreck/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ static void cmb_exec_cb (flux_future_t *f, void *arg)
int64_t pid = 0;
const char *type = NULL;
const char *state = NULL;
int status = 1;
const flux_msg_t *msg;
flux_t *h = flux_future_get_flux (f);
struct wreck_job *job = arg;
Expand All @@ -585,19 +586,16 @@ static void cmb_exec_cb (flux_future_t *f, void *arg)
flux_future_destroy (f);
return;
}
if (flux_msg_unpack (msg, "{s?s,s?s,s:i}",
if (flux_msg_unpack (msg, "{s?s,s?s,s?i,s:i}",
"type", &type, "state", &state,
"pid", &pid) < 0) {
"status", &status, "pid", &pid) < 0) {
flux_log_error (h, "cmb_exec_cb: flux_msg_unpack");
flux_future_destroy (f);
}

if (type && strcmp (type, "io") == 0)
spawn_io_cb (h, job, msg);
else if (strcmp (state, "Exited") == 0) {
int status = 1;
if (flux_msg_unpack (msg, "{s:i}", "status", &status) < 0)
flux_log_error (h, "spawn response: failed to unpack exit status");
else if (state && strcmp (state, "Exited") == 0) {
if (WIFSIGNALED (status))
flux_log_error (h, "job%ju: wrexecd: %s",
(uintmax_t) job->id,
Expand Down

0 comments on commit 544b307

Please sign in to comment.