diff options
Diffstat (limited to 'xorg-server/os')
-rw-r--r-- | xorg-server/os/connection.c | 12 | ||||
-rw-r--r-- | xorg-server/os/utils.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index 80489f0e2..b39969dcd 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -379,8 +379,8 @@ void NotifyParentProcess(void) { #if !defined(WIN32) - if (dynamic_display[0]) { - write(displayfd, dynamic_display, strlen(dynamic_display)); + if (displayfd >= 0) { + write(displayfd, display, strlen(display)); write(displayfd, "\n", 1); close(displayfd); } @@ -437,18 +437,18 @@ CreateWellKnownSockets(void) FD_ZERO(&WellKnownConnections); /* display is initialized to "0" by main(). It is then set to the display - * number if specified on the command line, or to NULL when the -displayfd - * option is used. */ + * number if specified on the command line. */ + if (NoListenAll) { ListenTransCount = 0; } - else if (display) { + else if ((displayfd < 0) || explicit_display) { if (TryCreateSocket(atoi(display), &partial) && ListenTransCount >= 1) if (!PartialNetwork && partial) FatalError ("Failed to establish all listening sockets"); } - else { /* -displayfd */ + else { /* -displayfd and no explicit display number */ Bool found = 0; for (i = 0; i < 65535 - X_TCP_PORT; i++) { if (TryCreateSocket(i, &partial) && ListenTransCount >= 1 && (PartialNetwork || !partial)) { diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c index c514ae11a..9e5eefddb 100644 --- a/xorg-server/os/utils.c +++ b/xorg-server/os/utils.c @@ -685,6 +685,7 @@ ProcessCommandLine(int argc, char *argv[]) else if (argv[i][0] == ':') { /* initialize display */ display = argv[i]; + explicit_display = TRUE; display++; if (!VerifyDisplayName(display)) { ErrorF("Bad display name: %s\n", display); @@ -763,7 +764,6 @@ ProcessCommandLine(int argc, char *argv[]) else if (strcmp(argv[i], "-displayfd") == 0) { if (++i < argc) { displayfd = atoi(argv[i]); - display = NULL; #ifdef LOCK_SERVER nolock = TRUE; #endif |