diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-09-29 11:24:19 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-09 17:25:23 +0100 |
commit | 10688efcf759f24e83814f9e12a1275296b07a4c (patch) | |
tree | 51d46d026e8cc9c04aae739e52582c6566c45112 /unix/xserver | |
parent | f43137c61bd19fd3a7a51833c9eb9bb9f890a904 (diff) | |
download | tigervnc-10688efcf759f24e83814f9e12a1275296b07a4c.tar.gz tigervnc-10688efcf759f24e83814f9e12a1275296b07a4c.zip |
Properly terminate server on timeouts
Do a proper cleanup when one of the termination timeouts trigger
rather than just exiting on the spot. This makes sure we don't leave
stray stuff around, e.g. unix socket files.
Diffstat (limited to 'unix/xserver')
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 6 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index e61472b3..d4891c3a 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -22,6 +22,7 @@ // #include <assert.h> +#include <signal.h> #include <stdio.h> #include <stdlib.h> #include <strings.h> @@ -423,6 +424,11 @@ void XserverDesktop::approveConnection(uint32_t opaqueId, bool accept, // SDesktop callbacks +void XserverDesktop::terminate() +{ + kill(getpid(), SIGTERM); +} + void XserverDesktop::pointerEvent(const Point& pos, int buttonMask) { vncPointerMove(pos.x + vncGetScreenX(screenIndex), diff --git a/unix/xserver/hw/vnc/XserverDesktop.h b/unix/xserver/hw/vnc/XserverDesktop.h index ff36b3b5..1253935f 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.h +++ b/unix/xserver/hw/vnc/XserverDesktop.h @@ -87,6 +87,7 @@ public: // rfb::SDesktop callbacks virtual void start(rfb::VNCServer* vs); virtual void stop(); + virtual void terminate(); virtual void queryConnection(network::Socket* sock, const char* userName); virtual void pointerEvent(const rfb::Point& pos, int buttonMask); |