Commit f4d7863f authored by Mike Gabriel's avatar Mike Gabriel

Xserver/os/connection.c: Accompany display number with some human-readable…

Xserver/os/connection.c: Accompany display number with some human-readable (machine-parseable) text when -displayfd is set to STDERR.
parent 7d0b7055
...@@ -79,6 +79,7 @@ SOFTWARE. ...@@ -79,6 +79,7 @@ SOFTWARE.
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#ifndef WIN32 #ifndef WIN32
#include <sys/socket.h> #include <sys/socket.h>
...@@ -364,6 +365,14 @@ NotifyParentProcess(void) ...@@ -364,6 +365,14 @@ NotifyParentProcess(void)
{ {
#if !defined(WIN32) #if !defined(WIN32)
if (displayfd >= 0) { 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)) if (write(displayfd, display, strlen(display)) != strlen(display))
FatalError("Cannot write display number to fd %d\n", displayfd); FatalError("Cannot write display number to fd %d\n", displayfd);
if (write(displayfd, "\n", 1) != 1) if (write(displayfd, "\n", 1) != 1)
......
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