summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-08-04 14:40:49 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-08-04 14:40:49 -0700
commit9cc39e441b8741b4b0b878d00e09f0366ff36146 (patch)
treed735f29c68ba64d1af23563b1c2d07a2488bea74
parent7d41013b0e295ec0444c2f9099679bb6018c812f (diff)
Support the instant-off API in SnowLeopard.
-rw-r--r--org.x.startx.plist.cpp2
-rw-r--r--privileged_startx/org.x.privileged_startx.plist.cpp2
-rw-r--r--xinit.c26
3 files changed, 30 insertions, 0 deletions
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 @@
</dict>
<key>ServiceIPC</key>
<true/>
+ <key>EnableTransactions</key>
+ <true/>
</dict>
</plist>
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 @@
</array>
<key>TimeOut</key>
<integer>120</integer>
+ <key>EnableTransactions</key>
+ <true/>
</dict>
</plist>
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 <setjmp.h>
#include <stdarg.h>
+#ifdef __APPLE__
+#include <Availability.h>
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+#include <vproc.h>
+#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);