diff options
Diffstat (limited to 'os/connection.c')
-rw-r--r-- | os/connection.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/os/connection.c b/os/connection.c index 3d33c4170..dddb5f8bc 100644 --- a/os/connection.c +++ b/os/connection.c @@ -416,12 +416,14 @@ CreateWellKnownSockets(void) else { /* -displayfd and no explicit display number */ Bool found = 0; for (i = 0; i < 65536 - X_TCP_PORT; i++) { - if (TryCreateSocket(i, &partial) && !partial) { - found = 1; - break; + ErrorF("Trying to create socket for display number %d\n", i); + if (TryCreateSocket(i, &partial) && + (ListenTransCount >= 1)) + if (PartialNetwork || !partial) { + found = 1; + break; } - else - CloseWellKnownConnections(); + CloseWellKnownConnections(); } if (!found) FatalError("Failed to find a socket to listen on"); |