summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-21 11:20:31 -0800
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-11-21 11:55:49 -0800
commitca64b5949d229a60a3c62b6d29d51873b7694bd6 (patch)
tree31ba15eec5fb5a92132a19e8a7c6f25030d4d985 /hw
parent701f8e3a94d2b659ebcfffd09acd1d66f9e797b8 (diff)
XQuartz: Don't use LS to find X11.app on Tiger.
(cherry picked from commit e62107e55261ef252a2a24dd26a60e5dd295d560)
Diffstat (limited to 'hw')
-rw-r--r--hw/xquartz/mach-startup/stub.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index a011c4ed9..bc4f7eca0 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -50,6 +50,8 @@
#include <signal.h>
+#include <AvailabilityMacros.h>
+
#include "launchd_fd.h"
#ifndef BUILD_DATE
@@ -66,6 +68,8 @@ static char x11_path[PATH_MAX + 1];
static pid_t x11app_pid = 0;
static void set_x11_path() {
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+
CFURLRef appURL = NULL;
CFBundleRef bundle = NULL;
OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
@@ -117,6 +121,10 @@ static void set_x11_path() {
kX11AppBundleId, (int)osstatus);
exit(11);
}
+#else
+ /* TODO: Make Tiger smarter... but TBH, this should never get called on Tiger... */
+ strlcpy(x11_path, "/Applications/Utilities/X11.app/Contents/MacOS/X11", sizeof(x11_path));
+#endif
}
static int connect_to_socket(const char *filename) {