]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Switch to newer xpc_transaction APIs.
authorMichael Sweet <michael.r.sweet@gmail.com>
Thu, 8 Jun 2017 18:19:45 +0000 (14:19 -0400)
committerMichael Sweet <michael.r.sweet@gmail.com>
Thu, 8 Jun 2017 18:19:45 +0000 (14:19 -0400)
scheduler/cups-lpd.c
scheduler/sysman.c

index 8d2ea49171fcd8d6c3dc538bec0f5933a1bddf08..5d5e6f8944cc10e24c8ee487102e0e9faf93a8bb 100644 (file)
@@ -29,7 +29,7 @@
 #  include <inttypes.h>
 #endif /* HAVE_INTTYPES_H */
 #ifdef __APPLE__
-#  include <vproc.h>
+#  include <xpc/xpc.h>
 #endif /* __APPLE__ */
 
 
@@ -97,8 +97,10 @@ main(int  argc,                              /* I - Number of command-line arguments */
                hostip[256],            /* IP address */
                *hostfamily;            /* Address family */
   int          hostlookups;            /* Do hostname lookups? */
+
+
 #ifdef __APPLE__
-  vproc_transaction_t vtran = vproc_transaction_begin(NULL);
+  xpc_transaction_begin();
 #endif /* __APPLE__ */
 
 
@@ -217,7 +219,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
     putchar(1);
 
 #ifdef __APPLE__
-    vproc_transaction_end(NULL, vtran);
+    xpc_transaction_end();
 #endif /* __APPLE__ */
 
     return (1);
@@ -313,7 +315,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
   closelog();
 
 #ifdef __APPLE__
-  vproc_transaction_end(NULL, vtran);
+  xpc_transaction_end();
 #endif /* __APPLE__ */
 
   return (status);
index 1a46c30694bf2e7d1a6bff4fbf67a3a13c26090d..8b43975d6a5ad1e51cbc0671ae5553302d74f4ce 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "cupsd.h"
 #ifdef __APPLE__
-#  include <vproc.h>
+#  include <xpc/xpc.h>
 #  include <IOKit/pwr_mgt/IOPMLib.h>
 #endif /* __APPLE__ */
 
@@ -129,7 +129,7 @@ cupsdSetBusyState(void)
     "Active clients, printing jobs, and dirty files"
   };
 #ifdef __APPLE__
-  static vproc_transaction_t vtran = 0;        /* Current busy transaction */
+  static int tran = 0; /* Current busy transaction */
   static IOPMAssertionID keep_awake = 0;/* Keep the system awake while printing */
 #endif /* __APPLE__ */
 
@@ -172,12 +172,15 @@ cupsdSetBusyState(void)
     busy = newbusy;
 
 #ifdef __APPLE__
-    if (busy && !vtran)
-      vtran = vproc_transaction_begin(NULL);
-    else if (!busy && vtran)
+    if (busy && !tran)
     {
-      vproc_transaction_end(NULL, vtran);
-      vtran = 0;
+      xpc_transaction_begin();
+      tran = 1;
+    }
+    else if (!busy && tran)
+    {
+      xpc_transaction_end();
+      tran = 0;
     }
 #endif /* __APPLE__ */
   }
@@ -350,7 +353,7 @@ cupsdStartSystemMonitor(void)
 
   pthread_mutex_init(&SysEventThreadMutex, NULL);
   pthread_cond_init(&SysEventThreadCond, NULL);
-  pthread_create(&SysEventThread, NULL, (void *(*)())sysEventThreadEntry, NULL);
+  pthread_create(&SysEventThread, NULL, (void *(*)(void *))sysEventThreadEntry, NULL);
 
  /*
   * Monitor for power source changes via dispatch queue...