]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/server.c
Load cups into easysw/current.
[thirdparty/cups.git] / scheduler / server.c
index 7cf7663910dd8a95a8dcbf08318876146fb2a620..74c2fc0712ad5dbff6d0a29eb7535c17bd3157dc 100644 (file)
@@ -1,9 +1,9 @@
 /*
- * "$Id: server.c 4830 2005-11-12 03:27:16Z mike $"
+ * "$Id: server.c 5095 2006-02-09 16:22:48Z mike $"
  *
  *   Server start/stop routines for the Common UNIX Printing System (CUPS).
  *
- *   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+ *   Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  *   These coded instructions, statements, and computer programs are the
  *   property of Easy Software Products and are protected by Federal
@@ -34,6 +34,9 @@
 #include <cups/http-private.h>
 #include "cupsd.h"
 #include <grp.h>
+#ifdef HAVE_NOTIFY_H
+#  include <notify.h>
+#endif /* HAVE_NOTIFY_H */
 
 
 /*
@@ -110,6 +113,14 @@ cupsdStartServer(void)
     FD_SET(CGIPipes[0], InputSet);
   }
 
+ /*
+  * Mark that the server has started and printers and jobs may be changed...
+  */
+
+  LastEvent     = CUPSD_EVENT_PRINTER_CHANGED | CUPSD_EVENT_JOB_STATE_CHANGED |
+                  CUPSD_EVENT_SERVER_STARTED;
+  LastEventTime = 0;
+
   started = 1;
 }
 
@@ -197,10 +208,20 @@ cupsdStopServer(void)
     PageFile = NULL;
   }
 
+#ifdef HAVE_NOTIFY_POST
+ /*
+  * Send one last notification as the server shuts down.
+  */
+
+  cupsdLogMessage(CUPSD_LOG_DEBUG,
+                  "notify_post(\"com.apple.printerListChange\") last");
+  notify_post("com.apple.printerListChange");
+#endif /* HAVE_NOTIFY_POST */
+
   started = 0;
 }
 
 
 /*
- * End of "$Id: server.c 4830 2005-11-12 03:27:16Z mike $".
+ * End of "$Id: server.c 5095 2006-02-09 16:22:48Z mike $".
  */