]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/subscriptions.c
Rework idle exit fix after some discussion.
[thirdparty/cups.git] / scheduler / subscriptions.c
index db6cfb1ffb22a58061525d1519a993e7d46967b4..0908f3c0cedc76a6f9ac88f561a9f46e47e0a38d 100644 (file)
@@ -1,16 +1,10 @@
 /*
- * "$Id$"
- *
  * Subscription routines for the CUPS scheduler.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2019 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
- * 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
- * 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.
  */
 
 /*
@@ -105,9 +99,7 @@ cupsdAddEvent(
     * Check if this subscription requires this event...
     */
 
-    if ((sub->mask & event) != 0 &&
-        (sub->dest == dest || !sub->dest) &&
-       (sub->job == job || !sub->job))
+    if ((sub->mask & event) != 0 && (sub->dest == dest || !sub->dest || sub->job == job))
     {
      /*
       * Need this event, so create a new event record...
@@ -656,9 +648,14 @@ cupsdExpireSubscriptions(
   time_t               curtime;        /* Current time */
 
 
+  if (cupsArrayCount(Subscriptions) == 0)
+    return;
+
   curtime = time(NULL);
   update  = 0;
 
+  cupsdLogMessage(CUPSD_LOG_INFO, "Expiring subscriptions...");
+
   for (sub = (cupsd_subscription_t *)cupsArrayFirst(Subscriptions);
        sub;
        sub = (cupsd_subscription_t *)cupsArrayNext(Subscriptions))
@@ -1614,8 +1611,3 @@ cupsd_update_notifier(void)
       break;
   }
 }
-
-
-/*
- * End of "$Id$".
- */