Skip to content

Commit

Permalink
fixup wrexecd_cmdline_create
Browse files Browse the repository at this point in the history
  • Loading branch information
grondo committed May 8, 2018
1 parent 544b307 commit 7a41a81
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/modules/wreck/job.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,20 +617,28 @@ static void cmb_exec_cb (flux_future_t *f, void *arg)

static json_t *wrexecd_cmdline_create (flux_t *h, struct wreck_job *job)
{
json_t *o;
json_t *o, *s;
const char *wrexecd_path;
char buf [4096];
int n;

if (!(wrexecd_path = flux_attr_get (h, "wrexec.wrexecd_path", NULL))) {
flux_log_error (h, "spawn_exec_handler: flux_attr_get");
flux_log_error (h, "wrexecd_cmdline_create: flux_attr_get");
return (NULL);
}
if (!(o = json_array ())) {
flux_log_error (h, "wrexecd_cmdlin_create: json_array");
flux_log_error (h, "wrexecd_cmdline_create: json_array");
return (NULL);
}
json_array_append_new (o, json_string (wrexecd_path));
if (!(s = json_string (wrexecd_path))) {
flux_log_error (h, "wrexecd_cmdline_create: json_string");
goto error;
}
if (json_array_append_new (o, s) < 0) {
json_decref (s);
flux_log_error (h, "wrexecd_cmdline_create: json_array_append_new");
goto error;
}

n = snprintf (buf, sizeof(buf), "--lwj-id=%ju", (uintmax_t) job->id);
if ((n >= sizeof (buf)) || (n < 0)) {
Expand Down

0 comments on commit 7a41a81

Please sign in to comment.