Commit ec185d7f authored by Mike Gabriel's avatar Mike Gabriel

Xserver/os/connection.c: If -displayfd and an explicit display port number are…

Xserver/os/connection.c: If -displayfd and an explicit display port number are given, use the explicit display number as a starting point for auto-detecting the next available display number.
parent f4d7863f
...@@ -427,7 +427,11 @@ CreateWellKnownSockets(void) ...@@ -427,7 +427,11 @@ CreateWellKnownSockets(void)
if (NoListenAll) { if (NoListenAll) {
ListenTransCount = 0; ListenTransCount = 0;
} }
#ifndef NXAGENT_SERVER
else if ((displayfd < 0) || explicit_display) { else if ((displayfd < 0) || explicit_display) {
#else
else if (displayfd < 0) {
#endif /* ! NXAGENT_SERVER */
if (TryCreateSocket(atoi(display), &partial) && if (TryCreateSocket(atoi(display), &partial) &&
ListenTransCount >= 1) ListenTransCount >= 1)
if (!PartialNetwork && partial) if (!PartialNetwork && partial)
...@@ -435,7 +439,14 @@ CreateWellKnownSockets(void) ...@@ -435,7 +439,14 @@ CreateWellKnownSockets(void)
} }
else { /* -displayfd and no explicit display number */ else { /* -displayfd and no explicit display number */
Bool found = 0; Bool found = 0;
#ifdef NXAGENT_SERVER
int i_offset = 0;
if (explicit_display)
i_offset = atoi(display);
for (i = i_offset; i < 65536 - X_TCP_PORT; i++) {
#else
for (i = 0; i < 65536 - X_TCP_PORT; i++) { for (i = 0; i < 65536 - X_TCP_PORT; i++) {
#endif /* NXAGENT_SERVER */
if (TryCreateSocket(i, &partial) && !partial) { if (TryCreateSocket(i, &partial) && !partial) {
found = 1; found = 1;
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment