aboutsummaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2015-09-14 14:35:05 +0200
committerPierre Ossman <ossman@cendio.se>2015-09-14 14:35:05 +0200
commite3ee57a95b246f6dbc5fb62723db86346967a516 (patch)
treee3b38f1cf43a6330a7c4dcd67e397f36ebf19fc9 /unix
parent6262bac01e7d7f5a535cbac0cc6e879cec1cc829 (diff)
downloadtigervnc-e3ee57a95b246f6dbc5fb62723db86346967a516.tar.gz
tigervnc-e3ee57a95b246f6dbc5fb62723db86346967a516.zip
Refuse to start Xvnc if we failed to initialise a screen
Starting Xvnc without having any VNC functionality is pretty much pointless. So terminate when that happens, making the situation easier to detect for startup scripts.
Diffstat (limited to 'unix')
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc5
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.h1
-rw-r--r--unix/xserver/hw/vnc/xvnc.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index e307e319..d9f989a9 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -205,6 +205,11 @@ void vncExtensionInit(void)
vncRegisterBlockHandlers();
}
+int vncExtensionIsActive(int scrIdx)
+{
+ return (desktop[scrIdx] != NULL);
+}
+
void vncCallReadBlockHandlers(fd_set * fds, struct timeval ** timeout)
{
for (int scr = 0; scr < vncGetScreenCount(); scr++)
diff --git a/unix/xserver/hw/vnc/vncExtInit.h b/unix/xserver/hw/vnc/vncExtInit.h
index 65cbbe40..6430ac05 100644
--- a/unix/xserver/hw/vnc/vncExtInit.h
+++ b/unix/xserver/hw/vnc/vncExtInit.h
@@ -50,6 +50,7 @@ extern int vncFbstride[];
extern int vncInetdSock;
void vncExtensionInit(void);
+int vncExtensionIsActive(int scrIdx);
void vncCallReadBlockHandlers(fd_set * fds, struct timeval ** timeout);
void vncCallReadWakeupHandlers(fd_set * fds, int nfds);
diff --git a/unix/xserver/hw/vnc/xvnc.c b/unix/xserver/hw/vnc/xvnc.c
index cac2aeeb..ee3dab25 100644
--- a/unix/xserver/hw/vnc/xvnc.c
+++ b/unix/xserver/hw/vnc/xvnc.c
@@ -1744,6 +1744,11 @@ void ProcessInputEvents(void)
void InitInput(int argc, char *argv[])
{
+ int i;
+ for (i = 0;i < screenInfo.numScreens;i++) {
+ if (!vncExtensionIsActive(i))
+ FatalError("failed to activate VNC extension for one or more screens");
+ }
mieqInit ();
}