rpms/cups/F-11 cups-str3425.patch,NONE,1.1 cups.spec,1.551,1.552

Tim Waugh twaugh at fedoraproject.org
Tue Dec 8 12:25:07 UTC 2009


Author: twaugh

Update of /cvs/pkgs/rpms/cups/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10831

Modified Files:
	cups.spec 
Added Files:
	cups-str3425.patch 
Log Message:
* Tue Dec  8 2009 Tim Waugh <twaugh at redhat.com> - 1:1.4.2-14
- The scheduler did not clean out completed jobs when
  PreserveJobHistory was turned off (STR #3425).


cups-str3425.patch:
 job.c  |    6 ++----
 main.c |   21 +++++++++++----------
 2 files changed, 13 insertions(+), 14 deletions(-)

--- NEW FILE cups-str3425.patch ---
diff -up cups-1.4.2/scheduler/job.c.str3425 cups-1.4.2/scheduler/job.c
--- cups-1.4.2/scheduler/job.c.str3425	2009-12-08 12:23:15.694500898 +0000
+++ cups-1.4.2/scheduler/job.c	2009-12-08 12:23:35.005500733 +0000
@@ -444,11 +444,11 @@ cupsdCleanJobs(void)
   cupsd_job_t	*job;			/* Current job */
 
 
-  if (MaxJobs <= 0)
+  if (MaxJobs <= 0 && JobHistory)
     return;
 
   for (job = (cupsd_job_t *)cupsArrayFirst(Jobs);
-       job && cupsArrayCount(Jobs) >= MaxJobs;
+       job && (cupsArrayCount(Jobs) >= MaxJobs || !JobHistory);
        job = (cupsd_job_t *)cupsArrayNext(Jobs))
     if (job->state_value >= IPP_JOB_CANCELED && !job->printer)
       cupsdDeleteJob(job, CUPSD_JOB_PURGE);
@@ -2670,8 +2670,6 @@ cupsdSetJobState(
 	  job->dirty = 1;
 	  cupsdMarkDirty(CUPSD_DIRTY_JOBS);
 	}
-	else if (!job->printer)
-	  cupsdDeleteJob(job, CUPSD_JOB_PURGE);
 	break;
   }
 
diff -up cups-1.4.2/scheduler/main.c.str3425 cups-1.4.2/scheduler/main.c
--- cups-1.4.2/scheduler/main.c.str3425	2009-12-08 12:23:15.695501397 +0000
+++ cups-1.4.2/scheduler/main.c	2009-12-08 12:23:35.007501250 +0000
@@ -397,7 +397,7 @@ main(int  argc,				/* I - Number of comm
     * parent's file descriptors to be blocking.  This is a workaround for a
     * limitation of userland libpthread on OpenBSD.
     */
-   
+
     _thread_sys_closefrom(0);
 #endif /* __OpenBSD__ */
 
@@ -844,8 +844,8 @@ main(int  argc,				/* I - Number of comm
 
     if (timeout == 86400 && Launchd && LaunchdTimeout && !NumPolled &&
         !cupsArrayCount(ActiveJobs) &&
-	(!Browsing || 
-	 (!BrowseRemoteProtocols && 
+	(!Browsing ||
+	 (!BrowseRemoteProtocols &&
 	  (!NumBrowsers || !BrowseLocalProtocols ||
 	   cupsArrayCount(Printers) == 0))))
     {
@@ -1073,6 +1073,7 @@ main(int  argc,				/* I - Number of comm
     if ((current_time - senddoc_time) >= 10)
     {
       cupsdCheckJobs();
+      cupsdCleanJobs();
       senddoc_time = current_time;
     }
 
@@ -1231,8 +1232,8 @@ main(int  argc,				/* I - Number of comm
 #endif /* HAVE_GSSAPI */
 
 #if defined(__APPLE__) && defined(HAVE_DLFCN_H)
- /* 
-  * Unload Print Service quota enforcement library (X Server only) 
+ /*
+  * Unload Print Service quota enforcement library (X Server only)
   */
 
   PSQUpdateQuotaProc = NULL;
@@ -1594,13 +1595,13 @@ launchd_checkin(void)
 
 	if (lis)
 	{
-	  cupsdLogMessage(CUPSD_LOG_DEBUG, 
+	  cupsdLogMessage(CUPSD_LOG_DEBUG,
 		  "launchd_checkin: Matched existing listener %s with fd %d...",
 		  httpAddrString(&(lis->address), s, sizeof(s)), fd);
 	}
 	else
 	{
-	  cupsdLogMessage(CUPSD_LOG_DEBUG, 
+	  cupsdLogMessage(CUPSD_LOG_DEBUG,
 		  "launchd_checkin: Adding new listener %s with fd %d...",
 		  httpAddrString(&addr, s, sizeof(s)), fd);
 
@@ -1654,12 +1655,12 @@ launchd_checkout(void)
 
  /*
   * Create or remove the launchd KeepAlive file based on whether
-  * there are active jobs, polling, browsing for remote printers or 
+  * there are active jobs, polling, browsing for remote printers or
   * shared printers to advertise...
   */
 
-  if ((cupsArrayCount(ActiveJobs) || NumPolled || 
-       (Browsing && 
+  if ((cupsArrayCount(ActiveJobs) || NumPolled ||
+       (Browsing &&
 	(BrowseRemoteProtocols ||
         (BrowseLocalProtocols && NumBrowsers && cupsArrayCount(Printers))))))
   {


Index: cups.spec
===================================================================
RCS file: /cvs/pkgs/rpms/cups/F-11/cups.spec,v
retrieving revision 1.551
retrieving revision 1.552
diff -u -p -r1.551 -r1.552
--- cups.spec	8 Dec 2009 12:20:56 -0000	1.551
+++ cups.spec	8 Dec 2009 12:25:07 -0000	1.552
@@ -70,6 +70,7 @@ Patch56: cups-sidechannel-intrs.patch
 Patch57: cups-media-empty-warning.patch
 Patch58: cups-str3435.patch
 Patch59: cups-str3436.patch
+Patch60: cups-str3425.patch
 
 Patch100: cups-lspp.patch
 Epoch: 1
@@ -244,6 +245,7 @@ module. 
 %patch57 -p1 -b .media-empty-warning
 %patch58 -p1 -b .str3435
 %patch59 -p1 -b .str3436
+%patch60 -p1 -b .str3425
 
 %if %lspp
 %patch100 -p1 -b .lspp
@@ -536,6 +538,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %changelog
 * Tue Dec  8 2009 Tim Waugh <twaugh at redhat.com> - 1:1.4.2-14
+- The scheduler did not clean out completed jobs when
+  PreserveJobHistory was turned off (STR #3425).
 - The web interface did not show completed jobs (STR #3436).
 - Authenticated printing did not always work when printing directly to
   a remote server (STR #3435).




More information about the fedora-extras-commits mailing list