[cups/f14] Don't delete job data files when restarted (STR #3880).

Tim Waugh twaugh at fedoraproject.org
Wed Jul 20 13:54:57 UTC 2011


commit 39d7e8f15beba12195894af7b7e0dd1dfb98f9b2
Author: Tim Waugh <twaugh at redhat.com>
Date:   Wed Jul 20 13:12:33 2011 +0100

    Don't delete job data files when restarted (STR #3880).

 cups-str3880.patch |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 cups.spec          |    8 +++++++-
 2 files changed, 53 insertions(+), 1 deletions(-)
---
diff --git a/cups-str3880.patch b/cups-str3880.patch
new file mode 100644
index 0000000..cd4c3fa
--- /dev/null
+++ b/cups-str3880.patch
@@ -0,0 +1,46 @@
+diff -up cups-1.4.7/scheduler/job.c.str3880 cups-1.4.7/scheduler/job.c
+--- cups-1.4.7/scheduler/job.c.str3880	2011-07-20 13:19:38.280543190 +0100
++++ cups-1.4.7/scheduler/job.c	2011-07-20 13:20:01.691126073 +0100
+@@ -291,7 +291,7 @@ cupsdCheckJobs(void)
+ 
+     if (job->kill_time && job->kill_time <= curtime)
+     {
+-      cupsdLogMessage(CUPSD_LOG_ERROR, "[Job %d] Stopping unresponsive job!", 
++      cupsdLogMessage(CUPSD_LOG_ERROR, "[Job %d] Stopping unresponsive job!",
+ 		      job->id);
+ 
+       stop_job(job, CUPSD_JOB_FORCE);
+@@ -1338,14 +1338,19 @@ cupsdDeleteJob(cupsd_job_t       *job,	/
+     free(job->compressions);
+     free(job->filetypes);
+ 
+-    while (job->num_files > 0)
++    if (action == CUPSD_JOB_PURGE)
+     {
+-      snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot,
+-	       job->id, job->num_files);
+-      unlink(filename);
++      while (job->num_files > 0)
++      {
++	snprintf(filename, sizeof(filename), "%s/d%05d-%03d", RequestRoot,
++		 job->id, job->num_files);
++	unlink(filename);
+ 
+-      job->num_files --;
++	job->num_files --;
++      }
+     }
++    else
++      job->num_files = 0;
+   }
+ 
+   if (job->history)
+@@ -3224,7 +3229,7 @@ get_options(cupsd_job_t *job,		/* I - Jo
+ 				 IPP_TAG_ZERO)) != NULL &&
+ 	(attr->value_tag == IPP_TAG_KEYWORD ||
+ 	 attr->value_tag == IPP_TAG_NAME) &&
+-	(ppd = _pwgGetOutputBin(pwg, attr->values[0].string.text)) != NULL) 
++	(ppd = _pwgGetOutputBin(pwg, attr->values[0].string.text)) != NULL)
+     {
+      /*
+       * Map output-bin to OutputBin option...
diff --git a/cups.spec b/cups.spec
index 0d98b7d..1d4fa5c 100644
--- a/cups.spec
+++ b/cups.spec
@@ -8,7 +8,7 @@
 Summary: Common Unix Printing System
 Name: cups
 Version: 1.4.7
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
@@ -67,6 +67,7 @@ Patch32: cups-ricoh-deviceid-oid.patch
 Patch33: cups-texttops-rotate-page.patch
 Patch34: cups-str3875.patch
 Patch35: cups-polld-busy-loop.patch
+Patch36: cups-str3880.patch
 
 Patch100: cups-lspp.patch
 
@@ -269,6 +270,8 @@ module.
 %patch34 -p1 -b .str3875
 # Avoid busy loop in cups-polld (bug #720921).
 %patch35 -p1 -b .polld-busy-loop
+# Don't delete job data files when restarted (STR #3880).
+%patch36 -p1 -b .str3880
 
 %if %lspp
 # LSPP support.
@@ -577,6 +580,9 @@ rm -rf $RPM_BUILD_ROOT
 %{php_extdir}/phpcups.so
 
 %changelog
+* Wed Jul 20 2011 Tim Waugh <twaugh at redhat.com> 1:1.4.7-8
+- Don't delete job data files when restarted (STR #3880).
+
 * Fri Jul 15 2011 Tim Waugh <twaugh at redhat.com> 1:1.4.7-7
 - Ship an rpm macro for where to put driver executables.
 


More information about the scm-commits mailing list