diff options
author | Pierre Ossman <ossman@cendio.se> | 2018-11-09 17:28:44 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2018-11-09 17:28:44 +0100 |
commit | b85febcd752f38cc05233db628795f8fea91795f (patch) | |
tree | 10bf7d316e0d37acbd8825c4118e51384ff995c3 /unix/x0vncserver | |
parent | f9de17665a3549e7e1eb44584ce73d6cafbd4c99 (diff) | |
parent | a4308c9ec45b0ebcafaed2280b442d2840098e4e (diff) | |
download | tigervnc-b85febcd752f38cc05233db628795f8fea91795f.tar.gz tigervnc-b85febcd752f38cc05233db628795f8fea91795f.zip |
Merge branch 'exittimer' of https://github.com/CendioOssman/tigervnc
Diffstat (limited to 'unix/x0vncserver')
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 6 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.h | 1 | ||||
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index 5f71ccb2..1fdc9e2c 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -19,6 +19,8 @@ */ #include <assert.h> +#include <signal.h> +#include <unistd.h> #include <rfb/LogWriter.h> @@ -273,6 +275,10 @@ void XDesktop::stop() { pb = 0; } +void XDesktop::terminate() { + kill(getpid(), SIGTERM); +} + bool XDesktop::isRunning() { return running; } diff --git a/unix/x0vncserver/XDesktop.h b/unix/x0vncserver/XDesktop.h index 7d060613..3e85aac3 100644 --- a/unix/x0vncserver/XDesktop.h +++ b/unix/x0vncserver/XDesktop.h @@ -49,6 +49,7 @@ public: // -=- SDesktop interface virtual void start(rfb::VNCServer* vs); virtual void stop(); + virtual void terminate(); bool isRunning(); virtual void queryConnection(network::Socket* sock, const char* userName); diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index c77870de..cf2c35a2 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -322,7 +322,7 @@ int main(int argc, char** argv) } } - soonestTimeout(&wait_ms, server.checkTimeouts()); + soonestTimeout(&wait_ms, Timer::checkTimeouts()); tv.tv_sec = wait_ms / 1000; tv.tv_usec = (wait_ms % 1000) * 1000; @@ -357,7 +357,7 @@ int main(int argc, char** argv) } } - server.checkTimeouts(); + Timer::checkTimeouts(); // Client list could have been changed. server.getSockets(&sockets); |