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

This commit is contained in:
Tim Waugh 2011-07-20 13:12:33 +01:00
parent f9ab38035f
commit 39d7e8f15b
2 changed files with 53 additions and 1 deletions

46
cups-str3880.patch Normal file
View File

@ -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...

View File

@ -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@redhat.com> 1:1.4.7-8
- Don't delete job data files when restarted (STR #3880).
* Fri Jul 15 2011 Tim Waugh <twaugh@redhat.com> 1:1.4.7-7
- Ship an rpm macro for where to put driver executables.