From dbcea8da9dd2480b260535b87dec64b665a2a663 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 8 Nov 2018 15:52:50 -0500 Subject: [PATCH] Switch from xpc_transaction_begin to os_transaction_create. --- scheduler/main.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scheduler/main.c b/scheduler/main.c index 472b9946dd..b3df1d9629 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -16,6 +16,9 @@ #include "cupsd.h" #include #ifdef __APPLE__ +# include +typedef struct os_transaction_s *os_transaction_t; +extern os_transaction_t os_transaction_create(const char *description); # include # include #endif /* __APPLE__ */ @@ -88,7 +91,11 @@ static int dead_children = 0; static int stop_scheduler = 0; /* Should the scheduler stop? */ static time_t local_timeout = 0; - /* Next local printer timeout */ + /* Next local printer timeout */ +#ifdef __APPLE__ +static os_transaction_t launchd_transaction = NULL; + /* Transaction for launchd */ +#endif /* __APPLE__ */ /* @@ -1965,7 +1972,7 @@ service_checkin(void) free(ld_sockets); # ifdef __APPLE__ - xpc_transaction_begin(); + launchd_transaction = os_transaction_create("org.cups.cupsd.active-printing"); # endif /* __APPLE__ */ } @@ -2107,8 +2114,11 @@ service_checkout(int shutdown) /* I - Shutting down? */ } # ifdef __APPLE__ - if (OnDemand && shutdown) - xpc_transaction_end(); + if (OnDemand && shutdown && launchd_transaction) + { + os_release(launchd_transaction); + launchd_transaction = NULL; + } # endif /* __APPLE__ */ } -- 2.47.2