diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-04-07 15:26:45 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2017-04-20 14:21:53 +0200 |
commit | f4d7863f81e8314e6fc1fac1ea6ac54da89eea56 (patch) | |
tree | 8ab95564025708a474a1a5ae41905de0472f1cbb /nx-X11/programs/Xserver | |
parent | 7d0b7055bf164761f1e6969efbb6af95c822da7d (diff) | |
download | nx-libs-f4d7863f81e8314e6fc1fac1ea6ac54da89eea56.tar.gz nx-libs-f4d7863f81e8314e6fc1fac1ea6ac54da89eea56.tar.bz2 nx-libs-f4d7863f81e8314e6fc1fac1ea6ac54da89eea56.zip |
Xserver/os/connection.c: Accompany display number with some human-readable (machine-parseable) text when -displayfd is set to STDERR.
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r-- | nx-X11/programs/Xserver/os/connection.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/os/connection.c b/nx-X11/programs/Xserver/os/connection.c index 8a5eb756a..18f964add 100644 --- a/nx-X11/programs/Xserver/os/connection.c +++ b/nx-X11/programs/Xserver/os/connection.c @@ -79,6 +79,7 @@ SOFTWARE. #include <signal.h> #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #ifndef WIN32 #include <sys/socket.h> @@ -364,6 +365,14 @@ NotifyParentProcess(void) { #if !defined(WIN32) if (displayfd >= 0) { +#ifdef NXAGENT_SERVER + if (displayfd == STDERR_FILENO) + { + const char *msg = "Auto-detected display number is: DISPLAY=:"; + if (write(displayfd, msg, strlen(msg)) != strlen(msg)) + FatalError("Cannot write display number to fd %d\n", displayfd); + } +#endif if (write(displayfd, display, strlen(display)) != strlen(display)) FatalError("Cannot write display number to fd %d\n", displayfd); if (write(displayfd, "\n", 1) != 1) |