From e33cc28b167cd393e5404e0540b4f07b90af5b94 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 19 Aug 2009 14:07:05 +0000 Subject: [PATCH] - Fixed JobKillDelay handling for cancelled jobs (bug #518026, STR #3292). --- cups-str3292.patch | 47 ++++++++++++++++++++++++++++++++++++++++++++++ cups.spec | 4 ++++ 2 files changed, 51 insertions(+) create mode 100644 cups-str3292.patch diff --git a/cups-str3292.patch b/cups-str3292.patch new file mode 100644 index 0000000..e53cfcf --- /dev/null +++ b/cups-str3292.patch @@ -0,0 +1,47 @@ +diff -up cups-1.4rc1/scheduler/job.c.cancel-job cups-1.4rc1/scheduler/job.c +--- cups-1.4rc1/scheduler/job.c.cancel-job 2009-08-19 14:48:55.733825903 +0100 ++++ cups-1.4rc1/scheduler/job.c 2009-08-19 14:49:01.813826101 +0100 +@@ -2359,19 +2359,21 @@ cupsdSetJobState( + break; + + case IPP_JOB_ABORTED : +- case IPP_JOB_CANCELED : + case IPP_JOB_COMPLETED : + /* +- * Expire job subscriptions since the job is now "completed"... ++ * Remove the job from the active list... + */ + +- cupsdExpireSubscriptions(NULL, job); ++ cupsArrayRemove(ActiveJobs, job); ++ ++ /* fall through... */ + ++ case IPP_JOB_CANCELED : + /* +- * Remove the job from the active list... ++ * Expire job subscriptions since the job is now "completed"... + */ + +- cupsArrayRemove(ActiveJobs, job); ++ cupsdExpireSubscriptions(NULL, job); + + #ifdef __APPLE__ + /* +diff -up cups-1.4rc1/scheduler/main.c.cancel-job cups-1.4rc1/scheduler/main.c +--- cups-1.4rc1/scheduler/main.c.cancel-job 2009-08-19 14:48:55.451701014 +0100 ++++ cups-1.4rc1/scheduler/main.c 2009-08-19 14:49:01.817825841 +0100 +@@ -1803,6 +1803,13 @@ process_children(void) + cupsdContinueJob(job); + } + } ++ else if (job->state_value == IPP_JOB_CANCELED) ++ { ++ for (i = 0; job->filters[i] < 0; i++); ++ ++ if (!job->filters[i] && job->backend < 0) ++ cupsArrayRemove(ActiveJobs, job); ++ } + } + } + diff --git a/cups.spec b/cups.spec index 83fb951..5512a37 100644 --- a/cups.spec +++ b/cups.spec @@ -67,6 +67,7 @@ Patch39: cups-str3284.patch Patch40: cups-str3285.patch Patch41: cups-str3279.patch Patch42: cups-str3287.patch +Patch43: cups-str3292.patch Patch100: cups-lspp.patch Epoch: 1 Url: http://www.cups.org/ @@ -234,6 +235,7 @@ module. %patch40 -p1 -b .str3285 %patch41 -p1 -b .str3279 %patch42 -p1 -b .str3287 +%patch43 -p1 -b .str3292 %if %lspp %patch100 -p1 -b .lspp @@ -529,6 +531,8 @@ rm -rf $RPM_BUILD_ROOT %changelog * Tue Aug 18 2009 Tim Waugh 1:1.4-0.rc1.16 +- Fixed JobKillDelay handling for cancelled jobs (bug #518026, + STR #3292). - Use 'exec' to invoke ghostscript in the pstoraster filter. This allows the SIGTERM signal to reach the correct process, as well as conserving memory (part of bug #518026).