diff options
Diffstat (limited to 'Xtrans.c')
-rw-r--r-- | Xtrans.c | 63 |
1 files changed, 1 insertions, 62 deletions
@@ -48,9 +48,6 @@ from The Open Group. */ #include <ctype.h> -#ifdef HAVE_LAUNCHD -#include <launch.h> -#endif /* * The transport table contains a definition for every transport (protocol) @@ -866,7 +863,7 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address) } #ifdef HAVE_LAUNCHD - if (!host || !*host) host=strdup(""); + if (!host) host=strdup(""); #endif if (!port || !*port) @@ -1064,11 +1061,6 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, char buffer[256]; /* ??? What size ?? */ XtransConnInfo ciptr, temp_ciptrs[NUMTRANS]; int status, i, j; -#ifdef HAVE_LAUNCHD - int launchd_fd; - launch_data_t sockets_dict, checkin_request, checkin_response; - launch_data_t listening_fd_array, listening_fd; -#endif #if defined(IPv6) && defined(AF_INET6) int ipv6_succ = 0; @@ -1078,59 +1070,6 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, *count_ret = 0; -#ifdef HAVE_LAUNCHD - /* Get launchd fd */ - if ((checkin_request = launch_data_new_string(LAUNCH_KEY_CHECKIN)) == NULL) { - fprintf(stderr,"launch_data_new_string(\"" LAUNCH_KEY_CHECKIN "\") Unable to create string.\n"); - goto not_launchd; - } - - if ((checkin_response = launch_msg(checkin_request)) == NULL) { - fprintf(stderr,"launch_msg(\"" LAUNCH_KEY_CHECKIN "\") IPC failure: %s\n",strerror(errno)); - goto not_launchd; - } - - if (LAUNCH_DATA_ERRNO == launch_data_get_type(checkin_response)) { - // ignore EACCES, which is common if we weren't started by launchd - if (launch_data_get_errno(checkin_response) != EACCES) - fprintf(stderr,"launchd check-in failed: %s\n",strerror(launch_data_get_errno(checkin_response))); - goto not_launchd; - } - - sockets_dict = launch_data_dict_lookup(checkin_response, LAUNCH_JOBKEY_SOCKETS); - if (NULL == sockets_dict) { - fprintf(stderr,"launchd check-in: no sockets found to answer requests on!\n"); - goto not_launchd; - } - - if (launch_data_dict_get_count(sockets_dict) > 1) { - fprintf(stderr,"launchd check-in: some sockets will be ignored!\n"); - goto not_launchd; - } - - listening_fd_array = launch_data_dict_lookup(sockets_dict, ":0"); - if (NULL == listening_fd_array) { - fprintf(stderr,"launchd check-in: No known sockets found to answer requests on!\n"); - goto not_launchd; - } - - if (launch_data_array_get_count(listening_fd_array)!=1) { - fprintf(stderr,"launchd check-in: Expected 1 socket from launchd, got %d)\n", - launch_data_array_get_count(listening_fd_array)); - goto not_launchd; - } - - listening_fd=launch_data_array_get_index(listening_fd_array, 0); - launchd_fd=launch_data_get_fd(listening_fd); - fprintf(stderr,"Xquartz: run by launchd for fd %d\n",launchd_fd); - if((ciptr = TRANS(ReopenCOTSServer(TRANS_SOCKET_LOCAL_INDEX, - launchd_fd, getenv("DISPLAY"))))==NULL) - fprintf(stderr,"Got NULL while trying to Reopen launchd port\n"); - else temp_ciptrs[(*count_ret)++] = ciptr; - -not_launchd: -#endif - for (i = 0; i < NUMTRANS; i++) { Xtransport *trans = Xtransports[i].transport; |