]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/sysman.c
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / scheduler / sysman.c
index 8b43975d6a5ad1e51cbc0671ae5553302d74f4ce..8c8cf1cdebc7d32e849875da53c2cbfa60170cbd 100644 (file)
@@ -1,14 +1,10 @@
 /*
  * System management functions for the CUPS scheduler.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2017 by Apple Inc.
  * Copyright 2006 by Easy Software Products.
  *
- * These coded instructions, statements, and computer programs are the
- * property of Apple Inc. and are protected by Federal copyright
- * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- * which should have been included with this file.  If this file is
- * missing or damaged, see the license at "http://www.cups.org/".
+ * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
  */
 
 
@@ -75,7 +71,7 @@ cupsdCleanDirty(void)
   DirtyFiles     = CUPSD_DIRTY_NONE;
   DirtyCleanTime = 0;
 
-  cupsdSetBusyState();
+  cupsdSetBusyState(0);
 }
 
 
@@ -101,7 +97,7 @@ cupsdMarkDirty(int what)             /* I - What file(s) are dirty? */
   if (!DirtyCleanTime)
     DirtyCleanTime = time(NULL) + DirtyCleanInterval;
 
-  cupsdSetBusyState();
+  cupsdSetBusyState(0);
 }
 
 
@@ -110,7 +106,7 @@ cupsdMarkDirty(int what)            /* I - What file(s) are dirty? */
  */
 
 void
-cupsdSetBusyState(void)
+cupsdSetBusyState(int working)          /* I - Doing significant work? */
 {
   int                  i;              /* Looping var */
   cupsd_job_t          *job;           /* Current job */
@@ -139,7 +135,7 @@ cupsdSetBusyState(void)
   */
 
   newbusy = (DirtyCleanTime ? 1 : 0) |
-           (cupsArrayCount(ActiveClients) ? 4 : 0);
+           ((working || cupsArrayCount(ActiveClients) > 0) ? 4 : 0);
 
   for (job = (cupsd_job_t *)cupsArrayFirst(PrintingJobs);
        job;