summaryrefslogtreecommitdiff
path: root/hw/xquartz
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-12-08 21:59:49 -0800
committerKeith Packard <keithp@keithp.com>2008-12-16 12:03:05 -0800
commit22d3ecda18ba799966d08237d8041ad80b20d0f2 (patch)
treeb07437dc4323fc8d9671a51c4f63cc0320772c17 /hw/xquartz
parent9eb5f3092984206ac7cab9a9fdb4b19448db3a24 (diff)
XQuartz: unset DISPLAY if we didn't get a launchd socket handoff
(cherry picked from commit b959727f38733009c6381cc8ca06b5984257bdac) (cherry picked from commit 9cbed0a325175e7ddb751db54fe6c0f5a5cedd16)
Diffstat (limited to 'hw/xquartz')
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 8b6d45849..6b48c132d 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -278,8 +278,12 @@ static int create_socket(char *filename_out) {
return 0;
}
+static int launchd_socket_handed_off = 0;
+
kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) {
socket_handoff_t *handoff_data;
+
+ launchd_socket_handed_off = 1;
handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t));
if(!handoff_data) {
@@ -318,6 +322,12 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
char **_envp = alloca((envpCnt + 1) * sizeof(char *));
size_t i;
+ /* If we didn't get handed a launchd DISPLAY socket, we shoul
+ * unset DISPLAY or we can run into problems with pbproxy
+ */
+ if(!launchd_socket_handed_off)
+ unsetenv("DISPLAY");
+
if(!_argv || !_envp) {
return KERN_FAILURE;
}