summaryrefslogtreecommitdiff
path: root/scheduler
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2019-02-21 10:43:16 -0500
committerMichael R Sweet <michael.r.sweet@gmail.com>2019-02-21 10:43:16 -0500
commit45cae1bc04117750d9a8b4722c257eeebc784cc7 (patch)
tree1ca0ed85d59be59c8e3ae8894dc9030729ef402f /scheduler
parent76bb0a3b90f09fa38747b69b863f884f487d646f (diff)
downloadcups-45cae1bc04117750d9a8b4722c257eeebc784cc7.tar.gz
Don't stop a printer after a job is canceled/aborted (Issue #5517)
Diffstat (limited to 'scheduler')
-rw-r--r--scheduler/job.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/scheduler/job.c b/scheduler/job.c
index da7cb9c08..d924b2eb5 100644
--- a/scheduler/job.c
+++ b/scheduler/job.c
@@ -1,7 +1,7 @@
/*
* Job management routines for the CUPS scheduler.
*
- * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 2007-2019 by Apple Inc.
* Copyright © 1997-2007 by Easy Software Products, all rights reserved.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more
@@ -3437,6 +3437,12 @@ finalize_job(cupsd_job_t *job, /* I - Job */
* Stop the printer...
*/
+ if (job_state == IPP_JSTATE_CANCELED || job_state == IPP_JSTATE_ABORTED)
+ {
+ cupsdLogJob(job, CUPSD_LOG_INFO, "Ignored STOP from backend since the job is %s.", job_state == IPP_JSTATE_CANCELED ? "canceled" : "aborted");
+ break;
+ }
+
printer_state = IPP_PRINTER_STOPPED;
if (ErrorLog)
@@ -3451,8 +3457,7 @@ finalize_job(cupsd_job_t *job, /* I - Job */
{
job_state = IPP_JOB_PENDING;
- ippSetString(job->attrs, &job->reasons, 0,
- "resources-are-not-ready");
+ ippSetString(job->attrs, &job->reasons, 0, "resources-are-not-ready");
}
break;