From 64dda3963f4d582d17aaea7b43233e29e2cef9a0 Mon Sep 17 00:00:00 2001 From: msweet Date: Fri, 6 Feb 2015 21:43:23 +0000 Subject: [PATCH] Enable transaction and pressured exit support () git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12493 a1ca3aef-8c08-0410-bb20-df032aa958be --- scheduler/cups-lpd.c | 17 ++++++++++++++++- scheduler/org.cups.cups-lpd.plist.in | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/scheduler/cups-lpd.c b/scheduler/cups-lpd.c index 50a5cb1f4..9df6bd0bd 100644 --- a/scheduler/cups-lpd.c +++ b/scheduler/cups-lpd.c @@ -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 #endif /* HAVE_INTTYPES_H */ +#ifdef __APPLE__ +# include +#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); } diff --git a/scheduler/org.cups.cups-lpd.plist.in b/scheduler/org.cups.cups-lpd.plist.in index 43eee68c1..c4fc8fe64 100644 --- a/scheduler/org.cups.cups-lpd.plist.in +++ b/scheduler/org.cups.cups-lpd.plist.in @@ -7,9 +7,9 @@ Label org.cups.cups-lpd EnableTransactions - + EnablePressuredExit - + ProgramArguments /usr/libexec/cups/daemon/cups-lpd -- 2.39.5