diff options
author | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-12-08 21:59:49 -0800 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@freedesktop.org> | 2008-12-10 15:05:44 -0800 |
commit | 9cbed0a325175e7ddb751db54fe6c0f5a5cedd16 (patch) | |
tree | 348608baaf8212da99baf5df672eede7c2c64726 | |
parent | 99b2cbf061a9d074e66e6220dc08f8b4624ea6bb (diff) |
XQuartz: unset DISPLAY if we didn't get a launchd socket handoff
(cherry picked from commit b959727f38733009c6381cc8ca06b5984257bdac)
-rw-r--r-- | hw/xquartz/mach-startup/bundle-main.c | 10 |
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) { | |||
278 | return 0; | 278 | return 0; |
279 | } | 279 | } |
280 | 280 | ||
281 | static int launchd_socket_handed_off = 0; | ||
282 | |||
281 | kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) { | 283 | kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) { |
282 | socket_handoff_t *handoff_data; | 284 | socket_handoff_t *handoff_data; |
285 | |||
286 | launchd_socket_handed_off = 1; | ||
283 | 287 | ||
284 | handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t)); | 288 | handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t)); |
285 | if(!handoff_data) { | 289 | if(!handoff_data) { |
@@ -318,6 +322,12 @@ kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv, | |||
318 | char **_envp = alloca((envpCnt + 1) * sizeof(char *)); | 322 | char **_envp = alloca((envpCnt + 1) * sizeof(char *)); |
319 | size_t i; | 323 | size_t i; |
320 | 324 | ||
325 | /* If we didn't get handed a launchd DISPLAY socket, we shoul | ||
326 | * unset DISPLAY or we can run into problems with pbproxy | ||
327 | */ | ||
328 | if(!launchd_socket_handed_off) | ||
329 | unsetenv("DISPLAY"); | ||
330 | |||
321 | if(!_argv || !_envp) { | 331 | if(!_argv || !_envp) { |
322 | return KERN_FAILURE; | 332 | return KERN_FAILURE; |
323 | } | 333 | } |