]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/sysman.c
Update ipp documentation to reflect the behavior of configuring WiFi on IPP USB printers.
[thirdparty/cups.git] / scheduler / sysman.c
index 8c8cf1cdebc7d32e849875da53c2cbfa60170cbd..81e3ed43bfc5c21fee9acc74c0f4865bceaf9cf6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * System management functions for the CUPS scheduler.
  *
- * Copyright 2007-2017 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 2006 by Easy Software Products.
  *
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
@@ -14,7 +14,6 @@
 
 #include "cupsd.h"
 #ifdef __APPLE__
-#  include <xpc/xpc.h>
 #  include <IOKit/pwr_mgt/IOPMLib.h>
 #endif /* __APPLE__ */
 
@@ -125,7 +124,6 @@ cupsdSetBusyState(int working)          /* I - Doing significant work? */
     "Active clients, printing jobs, and dirty files"
   };
 #ifdef __APPLE__
-  static int tran = 0; /* Current busy transaction */
   static IOPMAssertionID keep_awake = 0;/* Keep the system awake while printing */
 #endif /* __APPLE__ */
 
@@ -164,23 +162,8 @@ cupsdSetBusyState(int working)          /* I - Doing significant work? */
   */
 
   if (newbusy != busy)
-  {
     busy = newbusy;
 
-#ifdef __APPLE__
-    if (busy && !tran)
-    {
-      xpc_transaction_begin();
-      tran = 1;
-    }
-    else if (!busy && tran)
-    {
-      xpc_transaction_end();
-      tran = 0;
-    }
-#endif /* __APPLE__ */
-  }
-
 #ifdef __APPLE__
   if (cupsArrayCount(PrintingJobs) > 0 && !keep_awake)
   {
@@ -442,7 +425,7 @@ sysEventThreadEntry(void)
   * Register for power state change notifications
   */
 
-  bzero(&threadData, sizeof(threadData));
+  memset(&threadData, 0, sizeof(threadData));
 
   threadData.sysevent.powerKernelPort =
       IORegisterForSystemPower(&threadData, &powerNotifierPort,
@@ -453,15 +436,12 @@ sysEventThreadEntry(void)
     powerRLS = IONotificationPortGetRunLoopSource(powerNotifierPort);
     CFRunLoopAddSource(CFRunLoopGetCurrent(), powerRLS, kCFRunLoopDefaultMode);
   }
-  else
-    DEBUG_puts("sysEventThreadEntry: error registering for system power "
-               "notifications");
 
  /*
   * Register for system configuration change notifications
   */
 
-  bzero(&storeContext, sizeof(storeContext));
+  memset(&storeContext, 0, sizeof(storeContext));
   storeContext.info = &threadData;
 
   store = SCDynamicStoreCreate(kCFAllocatorDefault, CFSTR("cupsd"),
@@ -540,17 +520,8 @@ sysEventThreadEntry(void)
        CFRunLoopAddSource(CFRunLoopGetCurrent(), storeRLS,
                           kCFRunLoopDefaultMode);
       }
-      else
-       DEBUG_printf(("sysEventThreadEntry: SCDynamicStoreCreateRunLoopSource "
-                     "failed: %s\n", SCErrorString(SCError())));
     }
-    else
-      DEBUG_printf(("sysEventThreadEntry: SCDynamicStoreSetNotificationKeys "
-                    "failed: %s\n", SCErrorString(SCError())));
   }
-  else
-    DEBUG_printf(("sysEventThreadEntry: SCDynamicStoreCreate failed: %s\n",
-                  SCErrorString(SCError())));
 
   if (keys)
     CFRelease(keys);
@@ -565,7 +536,7 @@ sysEventThreadEntry(void)
   * this later.
   */
 
-  bzero(&timerContext, sizeof(timerContext));
+  memset(&timerContext, 0, sizeof(timerContext));
   timerContext.info = &threadData;
 
   threadData.timerRef =