aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os')
-rw-r--r--xorg-server/os/connection.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index 3ff93bbb6..61ba72a80 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -1253,10 +1253,11 @@ MakeClientGrabPervious(ClientPtr client)
void ListenOnOpenFD(int fd, int noxauth) {
char port[256];
XtransConnInfo ciptr;
+ const char *display_env = getenv("DISPLAY");
- if(!strncmp(getenv("DISPLAY"), "/tmp/launch", 11)) {
+ if(display_env && (strncmp(display_env, "/tmp/launch", 11) == 0)) {
/* Make the path the launchd socket if our DISPLAY is set right */
- strcpy(port, getenv("DISPLAY"));
+ strcpy(port, display_env);
} else {
/* Just some default so things don't break and die. */
sprintf(port, ":%d", atoi(display));