Apple: Apple launchd cleanup
Added --with-launchd option instead of just using __APPLE__ Fixed opening launchd fd when displayname=NULL
This commit is contained in:
parent
9b79ae49f7
commit
d79621b25b
|
@ -139,6 +139,15 @@ XCB_EXTENSION(XTest, "yes")
|
||||||
XCB_EXTENSION(Xv, "yes")
|
XCB_EXTENSION(Xv, "yes")
|
||||||
XCB_EXTENSION(XvMC, "yes")
|
XCB_EXTENSION(XvMC, "yes")
|
||||||
|
|
||||||
|
AC_ARG_WITH(launchd, AS_HELP_STRING([--with-launchd], [Build with support for Apple's launchd (default: auto)]), [LAUNCHD=$withval], [LAUNCHD=auto])
|
||||||
|
if test "x$LAUNCHD" = xauto; then
|
||||||
|
unset LAUNCHD
|
||||||
|
AC_CHECK_PROG(LAUNCHD, [launchd], [yes], [no])
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "x$LAUNCHD" = xyes ; then
|
||||||
|
AC_DEFINE(HAVE_LAUNCHD, 1, [launchd support available])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
|
|
|
@ -316,18 +316,21 @@ xcb_connection_t *xcb_connect(const char *displayname, int *screenp)
|
||||||
xcb_connection_t *c;
|
xcb_connection_t *c;
|
||||||
xcb_auth_info_t auth;
|
xcb_auth_info_t auth;
|
||||||
|
|
||||||
#ifdef __APPLE__
|
int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
|
||||||
|
|
||||||
|
#ifdef HAVE_LAUNCHD
|
||||||
|
if(!displayname)
|
||||||
|
displayname = getenv("DISPLAY");
|
||||||
if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11))
|
if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11))
|
||||||
fd = _xcb_open_unix(protocol, displayname);
|
fd = _xcb_open_unix(NULL, displayname);
|
||||||
else {
|
else
|
||||||
#endif
|
#endif
|
||||||
if(!_xcb_parse_display(displayname, &host, &protocol, &display, screenp))
|
if(!parsed)
|
||||||
return (xcb_connection_t *) &error_connection;
|
return (xcb_connection_t *) &error_connection;
|
||||||
fd = _xcb_open(host, protocol, display);
|
else
|
||||||
|
fd = _xcb_open(host, protocol, display);
|
||||||
free(host);
|
free(host);
|
||||||
#ifdef __APPLE__
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if(fd == -1)
|
if(fd == -1)
|
||||||
return (xcb_connection_t *) &error_connection;
|
return (xcb_connection_t *) &error_connection;
|
||||||
|
|
||||||
|
@ -348,18 +351,21 @@ xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *displayname,
|
||||||
char *host;
|
char *host;
|
||||||
char *protocol;
|
char *protocol;
|
||||||
|
|
||||||
#ifdef __APPLE__
|
int parsed = _xcb_parse_display(displayname, &host, &protocol, &display, screenp);
|
||||||
|
|
||||||
|
#ifdef HAVE_LAUNCHD
|
||||||
|
if(!displayname)
|
||||||
|
displayname = getenv("DISPLAY");
|
||||||
if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11))
|
if(displayname && strlen(displayname)>11 && !strncmp(displayname, "/tmp/launch", 11))
|
||||||
fd = _xcb_open_unix(protocol, displayname);
|
fd = _xcb_open_unix(NULL, displayname);
|
||||||
else {
|
else
|
||||||
#endif
|
#endif
|
||||||
if(!_xcb_parse_display(displayname, &host, &protocol, &display, screenp))
|
if(!parsed)
|
||||||
return (xcb_connection_t *) &error_connection;
|
return (xcb_connection_t *) &error_connection;
|
||||||
fd = _xcb_open(host, protocol, display);
|
else
|
||||||
|
fd = _xcb_open(host, protocol, display);
|
||||||
free(host);
|
free(host);
|
||||||
#ifdef __APPLE__
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if(fd == -1)
|
if(fd == -1)
|
||||||
return (xcb_connection_t *) &error_connection;
|
return (xcb_connection_t *) &error_connection;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue