break;
}
- /* If job has not been started at all, there is no need to stoping it,
- * can be simply canceled and removed from the watiting queue*/
+ /* If job has not been started at all, there is no need to stop it,
+ * can be simply canceled and removed from the waiting queue*/
if (cancel || not_running) {
status = JS_Canceled;
reason = _("canceled");
{
JCR *jcr;
bool ret = true;
- int nb;
bool cancel = strcasecmp(commands[ua->cmd_index].key, "cancel") == 0;
alist *jcrs = New(alist(5, not_owned_by_alist));
- /* If the user explicitely ask, we can send the cancel command to
+ /* If the user explicitly ask, we can send the cancel command to
* the FD.
*/
if (find_arg(ua, "inactive") > 0) {
goto bail_out;
}
- nb = select_running_jobs(ua, jcrs, commands[ua->cmd_index].key);
+ select_running_jobs(ua, jcrs, commands[ua->cmd_index].key);
foreach_alist(jcr, jcrs) {
- /* Execute the cancel command only if we don't have an error */
- if (nb != -1) {
- ret &= cancel_job(ua, jcr, 60, cancel);
- }
+ ret = cancel_job(ua, jcr, 60, cancel) && ret;
free_jcr(jcr);
}