From d2a5b01c7de7cafd2ab781302cb8e64a1ef83d91 Mon Sep 17 00:00:00 2001 From: Morris Jette <jette@schedmd.com> Date: Fri, 1 May 2015 13:51:00 -0700 Subject: [PATCH] Fix slurm_kill_job2() API The "flags" option was not being forwarded to the slurmctld, but was always set to 0. --- slurm/slurm.h.in | 8 ++------ src/api/cancel.c | 6 +++--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index c98a04e3fe4..81ec35da98c 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -2987,12 +2987,8 @@ extern int slurm_kill_job_step PARAMS((uint32_t job_id, uint32_t step_id, /* * slurm_kill_job2() */ -extern int slurm_kill_job2 PARAMS((const char *, uint16_t, uint16_t)); - -/* - * slurm_kill_job_step2() - */ -extern int slurm_kill_job_step2 PARAMS((const char *, uint16_t, uint16_t)); +extern int slurm_kill_job2 PARAMS((const char *job_id, uint16_t signal, + uint16_t flags)); /* * slurm_signal_job - send the specified signal to all steps of an existing job diff --git a/src/api/cancel.c b/src/api/cancel.c index 85795e4bfb0..4549088cf8f 100644 --- a/src/api/cancel.c +++ b/src/api/cancel.c @@ -112,7 +112,7 @@ slurm_kill_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) req.signal = signal; req.flags = 0; msg.msg_type = REQUEST_CANCEL_JOB_STEP; - msg.data = &req; + msg.data = &req; if (slurm_send_recv_controller_rc_msg(&msg, &rc) < 0) return SLURM_FAILURE; @@ -126,7 +126,7 @@ slurm_kill_job_step (uint32_t job_id, uint32_t step_id, uint16_t signal) /* slurm_kill_job2() */ int -slurm_kill_job2(const char *job_id, uint16_t signal, uint16_t batch_flag) +slurm_kill_job2(const char *job_id, uint16_t signal, uint16_t flags) { int cc; slurm_msg_t msg; @@ -144,7 +144,7 @@ slurm_kill_job2(const char *job_id, uint16_t signal, uint16_t batch_flag) req.sjob_id = xstrdup(job_id); req.job_step_id = NO_VAL; req.signal = signal; - req.flags = 0; + req.flags = flags; msg.msg_type = REQUEST_KILL_JOB; msg.data = &req; -- GitLab