XQuartz: More work towards Mach-IPC startup... started working on FD passing
(cherry picked from commit 27fbfeacfa16d620801ac3492b25c1e50aec8588)
This commit is contained in:
parent
82c4075d4b
commit
4be2104c80
|
@ -8,6 +8,7 @@ AM_CPPFLAGS = \
|
||||||
-DUSE_NEW_CLUT \
|
-DUSE_NEW_CLUT \
|
||||||
-DXFree86Server \
|
-DXFree86Server \
|
||||||
-I$(top_srcdir)/miext/rootless
|
-I$(top_srcdir)/miext/rootless
|
||||||
|
# -DNEW_LAUNCH_METHOD
|
||||||
|
|
||||||
SUBDIRS = bundle . GL xpr mach-startup doc
|
SUBDIRS = bundle . GL xpr mach-startup doc
|
||||||
|
|
||||||
|
|
|
@ -787,7 +787,6 @@ environment?", @"Startup xinitrc dialog");
|
||||||
|
|
||||||
void X11ApplicationMain (int argc, char **argv, char **envp) {
|
void X11ApplicationMain (int argc, char **argv, char **envp) {
|
||||||
NSAutoreleasePool *pool;
|
NSAutoreleasePool *pool;
|
||||||
int launchd_fd;
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
while (access ("/tmp/x11-block", F_OK) == 0) sleep (1);
|
while (access ("/tmp/x11-block", F_OK) == 0) sleep (1);
|
||||||
|
@ -818,9 +817,9 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
|
||||||
|
|
||||||
#ifndef NEW_LAUNCH_METHOD
|
#ifndef NEW_LAUNCH_METHOD
|
||||||
/* Start listening on the launchd fd */
|
/* Start listening on the launchd fd */
|
||||||
launchd_fd = launchd_display_fd();
|
int launchd_fd = launchd_display_fd();
|
||||||
if(launchd_fd != -1) {
|
if(launchd_fd != -1) {
|
||||||
DarwinSendDDXEvent(kXquartzListenOnOpenFD, 1, launchd_fd);
|
DarwinListenOnOpenFD(launchd_fd);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -551,6 +551,9 @@ void DarwinUpdateModKeys(int flags) {
|
||||||
old_flags = flags;
|
old_flags = flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DarwinListenOnOpenFD(int fd) {
|
||||||
|
DarwinSendDDXEvent(kXquartzListenOnOpenFD, 1, fd);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DarwinSendDDXEvent
|
* DarwinSendDDXEvent
|
||||||
|
|
|
@ -39,6 +39,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode);
|
||||||
void DarwinSendScrollEvents(float count_x, float count_y, int pointer_x, int pointer_y,
|
void DarwinSendScrollEvents(float count_x, float count_y, int pointer_x, int pointer_y,
|
||||||
float pressure, float tilt_x, float tilt_y);
|
float pressure, float tilt_x, float tilt_y);
|
||||||
void DarwinUpdateModKeys(int flags);
|
void DarwinUpdateModKeys(int flags);
|
||||||
|
void DarwinListenOnOpenFD(int fd);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special ddx events understood by the X server
|
* Special ddx events understood by the X server
|
||||||
|
|
|
@ -10,9 +10,9 @@ dist_X11_SOURCES = \
|
||||||
bundle-main.c \
|
bundle-main.c \
|
||||||
launchd_fd.c
|
launchd_fd.c
|
||||||
|
|
||||||
nodist_X11_SOURCES = \
|
#nodist_X11_SOURCES = \
|
||||||
mach_startupServer.c \
|
# mach_startupServer.c \
|
||||||
mach_startupUser.c
|
# mach_startupUser.c
|
||||||
|
|
||||||
X11_LDADD = \
|
X11_LDADD = \
|
||||||
$(top_builddir)/hw/xquartz/libXquartz.la \
|
$(top_builddir)/hw/xquartz/libXquartz.la \
|
||||||
|
@ -34,11 +34,11 @@ X11_LDFLAGS = \
|
||||||
bin_PROGRAMS = Xquartz
|
bin_PROGRAMS = Xquartz
|
||||||
|
|
||||||
dist_Xquartz_SOURCES = \
|
dist_Xquartz_SOURCES = \
|
||||||
stub.c \
|
stub.c
|
||||||
launchd_fd.c
|
# launchd_fd.c
|
||||||
|
|
||||||
nodist_Xquartz_SOURCES = \
|
#nodist_Xquartz_SOURCES = \
|
||||||
mach_startupUser.c
|
# mach_startupUser.c
|
||||||
|
|
||||||
Xquartz_LDFLAGS = \
|
Xquartz_LDFLAGS = \
|
||||||
-Wl,-framework,CoreServices
|
-Wl,-framework,CoreServices
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
promote the sale, use or other dealings in this Software without
|
promote the sale, use or other dealings in this Software without
|
||||||
prior written authorization. */
|
prior written authorization. */
|
||||||
|
|
||||||
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -35,10 +37,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
#include <asl.h>
|
|
||||||
|
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#include <mach/mach_error.h>
|
#include <mach/mach_error.h>
|
||||||
|
@ -56,6 +56,11 @@ static char *command_from_prefs(const char *key, const char *default_value);
|
||||||
/* This is in quartzStartup.c */
|
/* This is in quartzStartup.c */
|
||||||
int server_main(int argc, char **argv, char **envp);
|
int server_main(int argc, char **argv, char **envp);
|
||||||
|
|
||||||
|
static int execute(const char *command);
|
||||||
|
static char *command_from_prefs(const char *key, const char *default_value);
|
||||||
|
|
||||||
|
#ifdef NEW_LAUNCH_METHOD
|
||||||
|
|
||||||
struct arg {
|
struct arg {
|
||||||
int argc;
|
int argc;
|
||||||
char **argv;
|
char **argv;
|
||||||
|
@ -69,39 +74,6 @@ union MaxMsgSize {
|
||||||
union __ReplyUnion__mach_startup_subsystem rep;
|
union __ReplyUnion__mach_startup_subsystem rep;
|
||||||
};
|
};
|
||||||
|
|
||||||
kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
|
|
||||||
mach_msg_type_number_t argvCnt,
|
|
||||||
string_array_t envp,
|
|
||||||
mach_msg_type_number_t envpCnt) {
|
|
||||||
/* And now back to char ** */
|
|
||||||
char **_argv = alloca((argvCnt + 1) * sizeof(char *));
|
|
||||||
char **_envp = alloca((envpCnt + 1) * sizeof(char *));
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
if(!_argv || !_envp) {
|
|
||||||
return KERN_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(i=0; i < argvCnt; i++) {
|
|
||||||
_argv[i] = argv[i];
|
|
||||||
}
|
|
||||||
_argv[argvCnt] = NULL;
|
|
||||||
|
|
||||||
for(i=0; i < envpCnt; i++) {
|
|
||||||
_envp[i] = envp[i];
|
|
||||||
}
|
|
||||||
_envp[envpCnt] = NULL;
|
|
||||||
|
|
||||||
if(server_main(argvCnt, _argv, _envp) == 0)
|
|
||||||
return KERN_SUCCESS;
|
|
||||||
else
|
|
||||||
return KERN_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
kern_return_t do_exit(mach_port_t port, int value) {
|
|
||||||
exit(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static mach_port_t checkin_or_register(char *bname) {
|
static mach_port_t checkin_or_register(char *bname) {
|
||||||
kern_return_t kr;
|
kern_return_t kr;
|
||||||
mach_port_t mp;
|
mach_port_t mp;
|
||||||
|
@ -147,71 +119,99 @@ static pthread_t create_thread(void *func, void *arg) {
|
||||||
return tid;
|
return tid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*** Main ***/
|
/*** $DISPLAY handoff ***/
|
||||||
static int execute(const char *command);
|
static char display_handoff_socket[PATH_MAX + 1];
|
||||||
static char *command_from_prefs(const char *key, const char *default_value);
|
|
||||||
|
|
||||||
#ifdef NEW_LAUNCH_METHOD
|
kern_return_t do_get_display_handoff_socket(mach_port_t port, string_t filename) {
|
||||||
static void startup_trigger_thread(void *arg) {
|
strlcpy(filename, display_handoff_socket, STRING_T_SIZE);
|
||||||
struct arg args = *((struct arg *)arg);
|
fprintf(stderr, "Telling him the filename is %s = %s\n", filename, display_handoff_socket);
|
||||||
free(arg);
|
return KERN_SUCCESS;
|
||||||
startup_trigger(args.argc, args.argv, args.envp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv, char **envp) {
|
/* From darwinEvents.c ... but don't want to pull in all the server cruft */
|
||||||
Bool listen, listenOnly = FALSE;
|
void DarwinListenOnOpenFD(int fd);
|
||||||
int i;
|
|
||||||
mach_msg_size_t mxmsgsz = sizeof(union MaxMsgSize) + MAX_TRAILER_SIZE;
|
|
||||||
mach_port_t mp;
|
|
||||||
kern_return_t kr;
|
|
||||||
|
|
||||||
fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
|
static void accept_fd_handoff(int connectedSocket) {
|
||||||
for(i=1; i < argc; i++) {
|
int fd;
|
||||||
fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);
|
return;
|
||||||
if(!strcmp(argv[i], "--listenonly")) {
|
DarwinListenOnOpenFD(fd);
|
||||||
listenOnly = TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: This should be unconditional once we figure out fd passing */
|
/* This thread loops accepting incoming connections and handing off the file
|
||||||
listen = (argc > 1 && argv[1][0] == ':') || listenOnly;
|
* descriptor for the new connection to accept_fd_handoff()
|
||||||
if(listen) {
|
|
||||||
mp = checkin_or_register(SERVER_BOOTSTRAP_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check if we need to do something other than listen, and make another
|
|
||||||
* thread handle it.
|
|
||||||
*/
|
*/
|
||||||
if(!listenOnly) {
|
static void socket_handoff_thread(void *arg) {
|
||||||
struct arg *args = (struct arg*)malloc(sizeof(struct arg));
|
struct sockaddr_un servaddr_un;
|
||||||
if(!args) {
|
struct sockaddr *servaddr;
|
||||||
fprintf(stderr, "Memory allocation error.\n");
|
int handoff_fd;
|
||||||
return EXIT_FAILURE;
|
int servaddr_len;
|
||||||
|
|
||||||
|
/* Wipe ourselves clean */
|
||||||
|
memset (&servaddr_un, 0, sizeof (struct sockaddr_un));
|
||||||
|
|
||||||
|
servaddr_un.sun_family = AF_UNIX;
|
||||||
|
strcpy(servaddr_un.sun_path, display_handoff_socket);
|
||||||
|
servaddr = (struct sockaddr *) &servaddr_un;
|
||||||
|
servaddr_len = sizeof(struct sockaddr_un) - sizeof(servaddr_un.sun_path) + strlen(display_handoff_socket);
|
||||||
|
|
||||||
|
handoff_fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
|
if(handoff_fd == 0) {
|
||||||
|
fprintf(stderr, "Failed to create socket: %s - %s\n", display_handoff_socket, strerror(errno));
|
||||||
|
return;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
args->argc = argc;
|
if(bind(handoff_fd, servaddr, servaddr_len) != 0) {
|
||||||
args->argv = argv;
|
fprintf(stderr, "Failed to bind socket: %s - %s\n", display_handoff_socket, strerror(errno));
|
||||||
args->envp = envp;
|
return;
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
create_thread(startup_trigger_thread, args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: This should actually fall through rather than be the else
|
if(listen(handoff_fd, 10) != 0) {
|
||||||
* case once we figure out how to get the stub to pass the
|
fprintf(stderr, "Failed to listen to socket: %s - %s\n", display_handoff_socket, strerror(errno));
|
||||||
* file descriptor. For now, we only listen if we are explicitly
|
return;
|
||||||
* told to.
|
exit(EXIT_FAILURE);
|
||||||
*/
|
}
|
||||||
if(listen) {
|
|
||||||
/* Main event loop */
|
while(true) {
|
||||||
kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0);
|
int connectedSocket = accept(handoff_fd, NULL, NULL);
|
||||||
if (kr != KERN_SUCCESS) {
|
|
||||||
asl_log(NULL, NULL, ASL_LEVEL_ERR,
|
if(connectedSocket == -1) {
|
||||||
"org.x.X11(mp): %s\n", mach_error_string(kr));
|
fprintf(stderr, "Failed to accept incoming connection on socket: %s - %s\n", display_handoff_socket, strerror(errno));
|
||||||
return EXIT_FAILURE;
|
continue;
|
||||||
|
}
|
||||||
|
accept_fd_handoff(connectedSocket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
/*** Server Startup ***/
|
||||||
|
kern_return_t do_start_x11_server(mach_port_t port, string_array_t argv,
|
||||||
|
mach_msg_type_number_t argvCnt,
|
||||||
|
string_array_t envp,
|
||||||
|
mach_msg_type_number_t envpCnt) {
|
||||||
|
/* And now back to char ** */
|
||||||
|
char **_argv = alloca((argvCnt + 1) * sizeof(char *));
|
||||||
|
char **_envp = alloca((envpCnt + 1) * sizeof(char *));
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
if(!_argv || !_envp) {
|
||||||
|
return KERN_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i=0; i < argvCnt; i++) {
|
||||||
|
_argv[i] = argv[i];
|
||||||
|
}
|
||||||
|
_argv[argvCnt] = NULL;
|
||||||
|
|
||||||
|
for(i=0; i < envpCnt; i++) {
|
||||||
|
_envp[i] = envp[i];
|
||||||
|
}
|
||||||
|
_envp[envpCnt] = NULL;
|
||||||
|
|
||||||
|
if(server_main(argvCnt, _argv, _envp) == 0)
|
||||||
|
return KERN_SUCCESS;
|
||||||
|
else
|
||||||
|
return KERN_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int startup_trigger(int argc, char **argv, char **envp) {
|
int startup_trigger(int argc, char **argv, char **envp) {
|
||||||
|
@ -305,6 +305,72 @@ int main(int argc, char **argv, char **envp) {
|
||||||
return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
|
return execute(command_from_prefs("startx_script", DEFAULT_STARTX));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NEW_LAUNCH_METHOD
|
||||||
|
static void startup_trigger_thread(void *arg) {
|
||||||
|
struct arg args = *((struct arg *)arg);
|
||||||
|
free(arg);
|
||||||
|
startup_trigger(args.argc, args.argv, args.envp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** Main ***/
|
||||||
|
int main(int argc, char **argv, char **envp) {
|
||||||
|
Bool listenOnly = FALSE;
|
||||||
|
int i;
|
||||||
|
mach_msg_size_t mxmsgsz = sizeof(union MaxMsgSize) + MAX_TRAILER_SIZE;
|
||||||
|
mach_port_t mp;
|
||||||
|
kern_return_t kr;
|
||||||
|
|
||||||
|
fprintf(stderr, "X11.app: main(): argc=%d\n", argc);
|
||||||
|
for(i=1; i < argc; i++) {
|
||||||
|
fprintf(stderr, "\targv[%u] = %s\n", (unsigned)i, argv[i]);
|
||||||
|
if(!strcmp(argv[i], "--listenonly")) {
|
||||||
|
listenOnly = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mp = checkin_or_register(SERVER_BOOTSTRAP_NAME);
|
||||||
|
if(mp == MACH_PORT_NULL) {
|
||||||
|
fprintf(stderr, "NULL mach service: %s", SERVER_BOOTSTRAP_NAME);
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Figure out what our handoff socket will be
|
||||||
|
* TODO: cleanup on exit.
|
||||||
|
*/
|
||||||
|
tmpnam(display_handoff_socket);
|
||||||
|
create_thread(socket_handoff_thread, NULL);
|
||||||
|
|
||||||
|
fprintf(stderr, "Hi\n");
|
||||||
|
|
||||||
|
/* Check if we need to do something other than listen, and make another
|
||||||
|
* thread handle it.
|
||||||
|
*/
|
||||||
|
if(!listenOnly) {
|
||||||
|
struct arg *args = (struct arg*)malloc(sizeof(struct arg));
|
||||||
|
if(!args) {
|
||||||
|
fprintf(stderr, "Memory allocation error.\n");
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
args->argc = argc;
|
||||||
|
args->argv = argv;
|
||||||
|
args->envp = envp;
|
||||||
|
|
||||||
|
create_thread(startup_trigger_thread, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Main event loop */
|
||||||
|
fprintf(stderr, "Statrup coming...\n");
|
||||||
|
kr = mach_msg_server(mach_startup_server, mxmsgsz, mp, 0);
|
||||||
|
if (kr != KERN_SUCCESS) {
|
||||||
|
fprintf(stderr, "org.x.X11(mp): %s\n", mach_error_string(kr));
|
||||||
|
return EXIT_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int execute(const char *command) {
|
static int execute(const char *command) {
|
||||||
const char *newargv[7];
|
const char *newargv[7];
|
||||||
const char **s;
|
const char **s;
|
||||||
|
|
|
@ -33,9 +33,14 @@ import "mach_startup_types.h";
|
||||||
subsystem mach_startup 1000;
|
subsystem mach_startup 1000;
|
||||||
serverprefix do_;
|
serverprefix do_;
|
||||||
|
|
||||||
type string_array_t = array[] of c_string[1024];
|
type string_t = c_string[1024];
|
||||||
|
type string_array_t = array[] of string_t;
|
||||||
|
|
||||||
routine start_x11_server(
|
routine start_x11_server(
|
||||||
port : mach_port_t;
|
port : mach_port_t;
|
||||||
argv : string_array_t;
|
argv : string_array_t;
|
||||||
envp : string_array_t);
|
envp : string_array_t);
|
||||||
|
|
||||||
|
routine get_display_handoff_socket(
|
||||||
|
port : mach_port_t;
|
||||||
|
filename : string_t);
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
#include <servers/bootstrap.h>
|
#include <servers/bootstrap.h>
|
||||||
#include "mach_startup.h"
|
#include "mach_startup.h"
|
||||||
|
|
||||||
|
#include "launchd_fd.h"
|
||||||
|
|
||||||
static char x11_path[PATH_MAX + 1];
|
static char x11_path[PATH_MAX + 1];
|
||||||
|
|
||||||
static void set_x11_path() {
|
static void set_x11_path() {
|
||||||
|
@ -109,13 +111,15 @@ static void set_x11_path() {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int main(int argc, char **argv, char **envp) {
|
int main(int argc, char **argv, char **envp) {
|
||||||
#ifdef NEW_LAUNCH_METHOD_2
|
#ifdef NEW_LAUNCH_METHOD
|
||||||
int envpc;
|
int envpc;
|
||||||
kern_return_t kr;
|
kern_return_t kr;
|
||||||
mach_port_t mp;
|
mach_port_t mp;
|
||||||
string_array_t newenvp;
|
string_array_t newenvp;
|
||||||
string_array_t newargv;
|
string_array_t newargv;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
int launchd_fd;
|
||||||
|
string_t handoff_socket;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(argc == 2 && !strcmp(argv[1], "-version")) {
|
if(argc == 2 && !strcmp(argv[1], "-version")) {
|
||||||
|
@ -125,7 +129,10 @@ int main(int argc, char **argv, char **envp) {
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NEW_LAUNCH_METHOD_2
|
#ifdef NEW_LAUNCH_METHOD
|
||||||
|
/* Get the $DISPLAY FD */
|
||||||
|
launchd_fd = launchd_display_fd();
|
||||||
|
|
||||||
kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
|
kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
|
||||||
if(kr != KERN_SUCCESS) {
|
if(kr != KERN_SUCCESS) {
|
||||||
set_x11_path();
|
set_x11_path();
|
||||||
|
@ -147,7 +154,7 @@ int main(int argc, char **argv, char **envp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try connecting for 10 seconds */
|
/* Try connecting for 10 seconds */
|
||||||
for(i=0; i < 40; i++) {
|
for(i=0; i < 80; i++) {
|
||||||
usleep(250000);
|
usleep(250000);
|
||||||
kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
|
kr = bootstrap_look_up(bootstrap_port, SERVER_BOOTSTRAP_NAME, &mp);
|
||||||
if(kr == KERN_SUCCESS)
|
if(kr == KERN_SUCCESS)
|
||||||
|
@ -160,6 +167,12 @@ int main(int argc, char **argv, char **envp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Handoff the $DISPLAY FD */
|
||||||
|
if(launchd_fd != -1) {
|
||||||
|
get_display_handoff_socket(mp, handoff_socket);
|
||||||
|
fprintf(stderr, "Handoff socket: %s %d\n", handoff_socket, launchd_fd);
|
||||||
|
}
|
||||||
|
|
||||||
/* Count envp */
|
/* Count envp */
|
||||||
for(envpc=0; envp[envpc]; envpc++);
|
for(envpc=0; envp[envpc]; envpc++);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue