]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror backgrounding fix for macOS.
authorMichael R Sweet <michaelrsweet@gmail.com>
Wed, 18 Jul 2018 03:54:43 +0000 (23:54 -0400)
committerMichael R Sweet <michaelrsweet@gmail.com>
Wed, 18 Jul 2018 03:54:43 +0000 (23:54 -0400)
CHANGES.md
scheduler/main.c
scheduler/org.cups.cupsd.plist
scheduler/sysman.c

index 7f1b871c3590d6b8abc8692dc746ec6002f656e9..22f8e250328b5b5831b7d2f1f867372dd68c4293 100644 (file)
@@ -1,4 +1,4 @@
-CHANGES - 2.2.9 - 2018-06-29
+CHANGES - 2.2.9 - 2018-07-17
 ============================
 
 
@@ -14,6 +14,8 @@ Changes in CUPS v2.2.9
 - Fixed a crash bug in the Epson dot matrix driver (Issue #5323)
 - Automatic debug logging of job errors did not work with systemd (Issue #5337)
 - The web interface did not list the IPP Everywhere "driver" (Issue #5338)
+- The scheduler was being backgrounded on macOS, causing applications to spin
+  (rdar://40436080)
 - Authentication in the web interface did not work on macOS (rdar://41444473)
 - Dropped non-working RSS subscriptions UI from web interface templates.
 - Fixed a memory leak for some IPP (extension) syntaxes.
index acf031684e66a7423a38822e49a866e6baac0bd6..93e1eb89d8420dd4c188132bbf8506c49aaaa164 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Main loop for the CUPS scheduler.
  *
- * Copyright 2007-2017 by Apple Inc.
+ * Copyright 2007-2018 by Apple Inc.
  * Copyright 1997-2007 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -18,6 +18,9 @@
 #define _MAIN_C_
 #include "cupsd.h"
 #include <sys/resource.h>
+#ifdef __APPLE__
+#  include <xpc/xpc.h>
+#endif /* __APPLE__ */
 #ifdef HAVE_ASL_H
 #  include <asl.h>
 #elif defined(HAVE_SYSTEMD_SD_JOURNAL_H)
@@ -1946,6 +1949,10 @@ service_checkin(void)
       service_add_listener(ld_sockets[i], (int)i);
 
     free(ld_sockets);
+
+#  ifdef __APPLE__
+    xpc_transaction_begin();
+#  endif /* __APPLE__ */
   }
 
 #elif defined(HAVE_SYSTEMD)
@@ -2084,6 +2091,12 @@ service_checkout(int shutdown)          /* I - Shutting down? */
     else
       cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to create KeepAlive/PID file \"%s\": %s", pidfile, strerror(errno));
   }
+
+
+#  ifdef __APPLE__
+  if (shutdown)
+    xpc_transaction_end();
+#  endif /* __APPLE__ */
 }
 
 
index 8e1d0e96e5e3de295dfc1f2ee3220669576ed3cb..20ff05da7e0735cfeec7acb6100bc6f707a29703 100644 (file)
@@ -8,8 +8,6 @@
        <string>Adaptive</string>
        <key>EnableTransactions</key>
        <true/>
-       <key>EnablePressuredExit</key>
-       <false/>
        <key>ExitTimeOut</key>
        <integer>60</integer>
        <key>KeepAlive</key>
index 46eb39a0bc3d24c5431543c242c40a535d70ce89..42a8d1cf690081908272ca87008168df367c9a31 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.
  *
  * These coded instructions, statements, and computer programs are the
@@ -18,7 +18,6 @@
 
 #include "cupsd.h"
 #ifdef __APPLE__
-#  include <xpc/xpc.h>
 #  include <IOKit/pwr_mgt/IOPMLib.h>
 #endif /* __APPLE__ */
 
@@ -129,7 +128,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__ */
 
@@ -168,23 +166,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)
   {