aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-03 12:58:31 +0200
committermarha <marha@users.sourceforge.net>2012-05-03 12:58:31 +0200
commite230e5cc86752a7c8873135909e83ea12cec8160 (patch)
tree75003fb75892b83ffc28faaec1119eff59198779
parenta763a594aab34cdf0662859b8d2ffe5184cebf96 (diff)
downloadvcxsrv-e230e5cc86752a7c8873135909e83ea12cec8160.tar.gz
vcxsrv-e230e5cc86752a7c8873135909e83ea12cec8160.tar.bz2
vcxsrv-e230e5cc86752a7c8873135909e83ea12cec8160.zip
When -displayfd specified, assume it is a handle to shared memory to write
the display id to.
-rw-r--r--xorg-server/os/connection.c7
1 files changed, 7 insertions, 0 deletions
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;
}