diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-04-07 15:27:50 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-04-20 14:21:53 +0200 |
commit | ec185d7f7a5697d946c10c2dc58101dfe2d6aabf (patch) | |
tree | 4a13a8c812d4c0ccfe5acfb033ee599f227ec454 | |
parent | f4d7863f81e8314e6fc1fac1ea6ac54da89eea56 (diff) | |
download | nx-libs-ec185d7f7a5697d946c10c2dc58101dfe2d6aabf.tar.gz nx-libs-ec185d7f7a5697d946c10c2dc58101dfe2d6aabf.tar.bz2 nx-libs-ec185d7f7a5697d946c10c2dc58101dfe2d6aabf.zip |
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.
-rw-r--r-- | nx-X11/programs/Xserver/os/connection.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 18f964add..1b01e1c46 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -427,7 +427,11 @@ CreateWellKnownSockets(void) if (NoListenAll) { ListenTransCount = 0; } +#ifndef NXAGENT_SERVER else if ((displayfd < 0) || explicit_display) { +#else + else if (displayfd < 0) { +#endif /* ! NXAGENT_SERVER */ if (TryCreateSocket(atoi(display), &partial) && ListenTransCount >= 1) if (!PartialNetwork && partial) @@ -435,7 +439,14 @@ CreateWellKnownSockets(void) } else { /* -displayfd and no explicit display number */ 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++) { +#endif /* NXAGENT_SERVER */ if (TryCreateSocket(i, &partial) && !partial) { found = 1; break; |