aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/dix/globals.c3
-rw-r--r--nx-X11/programs/Xserver/include/opaque.h1
-rw-r--r--nx-X11/programs/Xserver/os/connection.c11
-rw-r--r--nx-X11/programs/Xserver/os/utils.c2
4 files changed, 9 insertions, 8 deletions
diff --git a/nx-X11/programs/Xserver/dix/globals.c b/nx-X11/programs/Xserver/dix/globals.c
index 5a3e22c26..f9fa544ed 100644
--- a/nx-X11/programs/Xserver/dix/globals.c
+++ b/nx-X11/programs/Xserver/dix/globals.c
@@ -149,7 +149,8 @@ int defaultColorVisualClass = -1;
int monitorResolution = 0;
char *display;
-int displayfd;
+int displayfd = -1;
+Bool explicit_display = FALSE;
CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
int argcGlobal;
diff --git a/nx-X11/programs/Xserver/include/opaque.h b/nx-X11/programs/Xserver/include/opaque.h
index 1b84b9f5b..8312b4a21 100644
--- a/nx-X11/programs/Xserver/include/opaque.h
+++ b/nx-X11/programs/Xserver/include/opaque.h
@@ -53,6 +53,7 @@ extern int argcGlobal;
extern char **argvGlobal;
extern char *display;
extern int displayfd;
+extern Bool explicit_display;
extern int defaultBackingStore;
extern Bool disableBackingStore;
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c
index 8958c47b5..7638cdfdd 100644
--- a/nx-X11/programs/Xserver/os/connection.c
+++ b/nx-X11/programs/Xserver/os/connection.c
@@ -361,8 +361,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));
close(displayfd);
}
if (RunFromSmartParent) {
@@ -410,18 +410,17 @@ 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) && !partial) {
diff --git a/nx-X11/programs/Xserver/os/utils.c b/nx-X11/programs/Xserver/os/utils.c
index dce04e942..6995d05d5 100644
--- a/nx-X11/programs/Xserver/os/utils.c
+++ b/nx-X11/programs/Xserver/os/utils.c
@@ -704,6 +704,7 @@ ProcessCommandLine(int argc, char *argv[])
{
/* initialize display */
display = argv[i];
+ explicit_display = TRUE;
display++;
if( ! VerifyDisplayName( display ) ) {
ErrorF("Bad display name: %s\n", display);
@@ -783,7 +784,6 @@ ProcessCommandLine(int argc, char *argv[])
else if (strcmp(argv[i], "-displayfd") == 0) {
if (++i < argc) {
displayfd = atoi(argv[i]);
- display = NULL;
nolock = TRUE;
}
else