]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - scheduler/cups-lpd.c
Enable transaction and pressured exit support (<rdar://problem/19749501>)
[thirdparty/cups.git] / scheduler / cups-lpd.c
index 50a5cb1f41a44bf24fe174c0894a64bc5d1b3866..9df6bd0bd659048627a63e912f4ca2b3c419a7e6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Line Printer Daemon interface for CUPS.
  *
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
  * Copyright 1997-2006 by Easy Software Products, all rights reserved.
  *
  * These coded instructions, statements, and computer programs are the
@@ -29,6 +29,9 @@
 #ifdef HAVE_INTTYPES_H
 #  include <inttypes.h>
 #endif /* HAVE_INTTYPES_H */
+#ifdef __APPLE__
+#  include <vproc.h>
+#endif /* __APPLE__ */
 
 
 /*
@@ -96,6 +99,9 @@ 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);
+#endif /* __APPLE__ */
 
 
  /*
@@ -211,6 +217,11 @@ main(int  argc,                            /* I - Number of command-line arguments */
 
     syslog(LOG_ERR, "Unable to get command line from client!");
     putchar(1);
+
+#ifdef __APPLE__
+    vproc_transaction_end(NULL, vtran);
+#endif /* __APPLE__ */
+
     return (1);
   }
 
@@ -301,6 +312,10 @@ main(int  argc,                            /* I - Number of command-line arguments */
   syslog(LOG_INFO, "Closing connection");
   closelog();
 
+#ifdef __APPLE__
+  vproc_transaction_end(NULL, vtran);
+#endif /* __APPLE__ */
+
   return (status);
 }