diff options
author | Michael Sweet <michael.r.sweet@gmail.com> | 2017-06-08 14:19:45 -0400 |
---|---|---|
committer | Michael Sweet <michael.r.sweet@gmail.com> | 2017-06-08 14:19:45 -0400 |
commit | 0668b48c105b66e84e8513a3a972471b65f1302c (patch) | |
tree | b7a4572661d2efcba21ec25e50d65283957d4340 /scheduler/sysman.c | |
parent | 718ee2fff3cfeedf69dedf4ca68b14e2f49ff8c6 (diff) | |
download | cups-0668b48c105b66e84e8513a3a972471b65f1302c.tar.gz |
Switch to newer xpc_transaction APIs.
Diffstat (limited to 'scheduler/sysman.c')
-rw-r--r-- | scheduler/sysman.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/scheduler/sysman.c b/scheduler/sysman.c index 1a46c3069..8b43975d6 100644 --- a/scheduler/sysman.c +++ b/scheduler/sysman.c @@ -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... |