Ticket #53108: launchd.patch
File launchd.patch, 930 bytes (added by Schamschula (Marius Schamschula), 7 years ago) |
---|
-
(a) a/channels.c.orig vs. (b) b/channels.c
a b 4565 4565 */ 4566 4566 4567 4567 #ifdef __APPLE__ 4568 /* Check if display is a path to a socket (as set by launchd). */4568 /* Check if the display is a path to a socket (as set by launchd). */ 4569 4569 { 4570 4570 char path[PATH_MAX]; 4571 struct stat sbuf; 4572 int is_path_to_socket = 0; 4571 4573 4572 if (is_path_to_xsocket(display, path, sizeof(path))) { 4573 debug("x11_connect_display: $DISPLAY is launchd"); 4574 4575 /* Create a socket. */ 4574 strlcpy(path, display, sizeof(path)); 4575 if (0 == stat(path, &sbuf)) { 4576 is_path_to_socket = 1; 4577 } else { 4578 char *dot = strrchr(path, '.'); 4579 if (dot) { 4580 *dot = '\0'; 4581 /* screen = atoi(dot 1); */ 4582 if (0 == stat(path, &sbuf)) { 4583 is_path_to_socket=1; 4584 } 4585 } 4586 } 4587 4588 if (is_path_to_socket) { 4576 4589 sock = connect_local_xsocket_path(path); 4577 4590 if (sock < 0) 4578 4591 return -1;