]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/server.c
Fix source file header text duplication text duplication.
[thirdparty/cups.git] / scheduler / server.c
index 438b142dc048799f1e64b845247ce126add6d8b7..04b26d64d2d1fd0180c85a74df0da53eb4a8d987 100644 (file)
@@ -1,21 +1,14 @@
 /*
- * "$Id: server.c 7927 2008-09-10 22:05:29Z mike $"
+ * Server start/stop routines for the CUPS scheduler.
  *
- *   Server start/stop routines for the CUPS scheduler.
+ * Copyright 2007-2012 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
- *   Copyright 2007-2010 by Apple Inc.
- *   Copyright 1997-2006 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/".
- *
- * Contents:
- *
- *   cupsdStartServer() - Start the server.
- *   cupsdStopServer()  - Stop the server.
+ * 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/".
  */
 
 /*
@@ -34,7 +27,7 @@
  * Local globals...
  */
 
-static int     started = 0;
+static int             started = 0;    /* Did we start the server already? */
 
 
 /*
@@ -44,11 +37,17 @@ static int  started = 0;
 void
 cupsdStartServer(void)
 {
+ /*
+  * Start color management (as needed)...
+  */
+
+  cupsdStartColor();
+
  /*
   * Create the default security profile...
   */
 
-  DefaultProfile = cupsdCreateProfile(0);
+  DefaultProfile = cupsdCreateProfile(0, 1);
 
  /*
   * Startup all the networking stuff...
@@ -56,7 +55,6 @@ cupsdStartServer(void)
 
   cupsdStartListening();
   cupsdStartBrowsing();
-  cupsdStartPolling();
 
  /*
   * Create a pipe for CGI processes...
@@ -95,12 +93,17 @@ cupsdStopServer(void)
     return;
 
  /*
-  * Close all network clients and stop all jobs...
+  * Stop color management (as needed)...
+  */
+
+  cupsdStopColor();
+
+ /*
+  * Close all network clients...
   */
 
   cupsdCloseAllClients();
   cupsdStopListening();
-  cupsdStopPolling();
   cupsdStopBrowsing();
   cupsdStopAllNotifiers();
   cupsdDeleteAllCerts();
@@ -126,37 +129,30 @@ cupsdStopServer(void)
     CGIPipes[1] = -1;
   }
 
-#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 */
-
  /*
   * Close all log files...
   */
 
   if (AccessFile != NULL)
   {
-    cupsFileClose(AccessFile);
+    if (AccessFile != LogStderr)
+      cupsFileClose(AccessFile);
 
     AccessFile = NULL;
   }
 
   if (ErrorFile != NULL)
   {
-    cupsFileClose(ErrorFile);
+    if (ErrorFile != LogStderr)
+      cupsFileClose(ErrorFile);
 
     ErrorFile = NULL;
   }
 
   if (PageFile != NULL)
   {
-    cupsFileClose(PageFile);
+    if (PageFile != LogStderr)
+      cupsFileClose(PageFile);
 
     PageFile = NULL;
   }
@@ -177,8 +173,3 @@ cupsdStopServer(void)
 
   started = 0;
 }
-
-
-/*
- * End of "$Id: server.c 7927 2008-09-10 22:05:29Z mike $".
- */