From 9cc39e441b8741b4b0b878d00e09f0366ff36146 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Mon, 4 Aug 2008 14:40:49 -0700 Subject: Support the instant-off API in SnowLeopard. --- org.x.startx.plist.cpp | 2 ++ .../org.x.privileged_startx.plist.cpp | 2 ++ xinit.c | 26 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/org.x.startx.plist.cpp b/org.x.startx.plist.cpp index 42c9f70..4bcedcf 100644 --- a/org.x.startx.plist.cpp +++ b/org.x.startx.plist.cpp @@ -21,5 +21,7 @@ ServiceIPC + EnableTransactions + diff --git a/privileged_startx/org.x.privileged_startx.plist.cpp b/privileged_startx/org.x.privileged_startx.plist.cpp index d0e41a6..fd87478 100644 --- a/privileged_startx/org.x.privileged_startx.plist.cpp +++ b/privileged_startx/org.x.privileged_startx.plist.cpp @@ -17,5 +17,7 @@ TimeOut 120 + EnableTransactions + diff --git a/xinit.c b/xinit.c index 523cfd5..0336a7b 100644 --- a/xinit.c +++ b/xinit.c @@ -60,6 +60,13 @@ in this Software without prior written authorization from The Open Group. #include #include +#ifdef __APPLE__ +#include +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 +#include +#endif +#endif + #if !defined(SIGCHLD) && defined(SIGCLD) #define SIGCHLD SIGCLD #endif @@ -250,6 +257,11 @@ main(int argc, char *argv[], char *envp[]) int client_args_given = 0, server_args_given = 0; int start_of_client_args, start_of_server_args; struct sigaction sa; +#ifdef __APPLE__ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + vproc_transaction_t vt; +#endif +#endif #ifdef __UNIXOS2__ envsave = envp; /* circumvent an EMX problem */ @@ -426,6 +438,13 @@ main(int argc, char *argv[], char *envp[]) signal(SIGALRM, sigAlarm); signal(SIGUSR1, sigUsr1); + +#ifdef __APPLE__ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + vt = vproc_transaction_begin(NULL); +#endif +#endif + if (startServer(server) > 0 && startClient(client) > 0) { pid = -1; @@ -434,6 +453,13 @@ main(int argc, char *argv[], char *envp[]) ) pid = wait(NULL); } + +#ifdef __APPLE__ +#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 + vproc_transaction_end(NULL, vt); +#endif +#endif + signal(SIGTERM, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGINT, SIG_IGN); -- cgit v1.2.3