From e230e5cc86752a7c8873135909e83ea12cec8160 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 3 May 2012 12:58:31 +0200 Subject: When -displayfd specified, assume it is a handle to shared memory to write the display id to. --- xorg-server/os/connection.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c index 1685292ce..e9b633523 100644 --- a/xorg-server/os/connection.c +++ b/xorg-server/os/connection.c @@ -153,6 +153,7 @@ static Pid_t ParentProcess; Bool RunFromSigStopParent; /* send SIGSTOP to our own process; Upstart (or equivalent) will send SIGCONT back. */ static char dynamic_display[7]; /* display name */ +static int dynamic_display_id; Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Bool debug_conns = FALSE; @@ -388,6 +389,11 @@ NotifyParentProcess(void) } if (RunFromSigStopParent) raise(SIGSTOP); +#else +/* On windows the displayfd points to shared memory, so write the id to it */ + int *pDisplayfd=(int*)MapViewOfFile((HANDLE)displayfd, FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, 0); + if (pDisplayfd) + *pDisplayfd=dynamic_display_id; #endif } @@ -449,6 +455,7 @@ CreateWellKnownSockets(void) } if (!found) FatalError("Failed to find a socket to listen on"); + dynamic_display_id=i; snprintf(dynamic_display, sizeof(dynamic_display), "%d", i); display = dynamic_display; } -- cgit v1.2.3