XQuartz: unset DISPLAY if we didn't get a launchd socket handoff
(cherry picked from commit b959727f38733009c6381cc8ca06b5984257bdac)
This commit is contained in:
parent
ecaaf0462d
commit
e5ce6e198f
|
@ -278,8 +278,12 @@ static int create_socket(char *filename_out) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int launchd_socket_handed_off = 0;
|
||||||
|
|
||||||
kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) {
|
kern_return_t do_request_fd_handoff_socket(mach_port_t port, string_t filename) {
|
||||||
socket_handoff_t *handoff_data;
|
socket_handoff_t *handoff_data;
|
||||||
|
|
||||||
|
launchd_socket_handed_off = 1;
|
||||||
|
|
||||||
handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t));
|
handoff_data = (socket_handoff_t *)calloc(1,sizeof(socket_handoff_t));
|
||||||
if(!handoff_data) {
|
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 *));
|
char **_envp = alloca((envpCnt + 1) * sizeof(char *));
|
||||||
size_t i;
|
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) {
|
if(!_argv || !_envp) {
|
||||||
return KERN_FAILURE;
|
return KERN_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue