aboutsummaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-09-03 07:31:15 +0200
committerPierre Ossman <ossman@cendio.se>2024-11-06 21:06:27 +0100
commit9e9083cbedc0e98a03a0da370dd49375dc1cdc91 (patch)
tree3b094052cd0d4941e8a554ad3b04ec19c0d3f0c3 /unix
parentf25de739ea359c2843a596457bcd22a28175b7a4 (diff)
downloadtigervnc-9e9083cbedc0e98a03a0da370dd49375dc1cdc91.tar.gz
tigervnc-9e9083cbedc0e98a03a0da370dd49375dc1cdc91.zip
Subclass exceptions from std::exception
Make sure our exceptions are part of the standard exception class hierarchy.
Diffstat (limited to 'unix')
-rw-r--r--unix/vncconfig/vncconfig.cxx2
-rw-r--r--unix/x0vncserver/XDesktop.cxx2
-rw-r--r--unix/x0vncserver/x0vncserver.cxx2
-rw-r--r--unix/xserver/hw/vnc/RFBGlue.cc2
-rw-r--r--unix/xserver/hw/vnc/XserverDesktop.cc21
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc18
6 files changed, 23 insertions, 24 deletions
diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx
index 94d81cc7..421b45f9 100644
--- a/unix/vncconfig/vncconfig.cxx
+++ b/unix/vncconfig/vncconfig.cxx
@@ -335,7 +335,7 @@ int main(int argc, char** argv)
XCloseDisplay(dpy);
- } catch (rdr::Exception &e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
}
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
index a083e01e..9251e371 100644
--- a/unix/x0vncserver/XDesktop.cxx
+++ b/unix/x0vncserver/XDesktop.cxx
@@ -1049,7 +1049,7 @@ bool XDesktop::setCursor()
try {
server->setCursor(cim->width, cim->height, Point(cim->xhot, cim->yhot),
cursorData);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setCursor: %s",e.what());
}
diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx
index cc668628..81e07d57 100644
--- a/unix/x0vncserver/x0vncserver.cxx
+++ b/unix/x0vncserver/x0vncserver.cxx
@@ -475,7 +475,7 @@ int main(int argc, char** argv)
}
}
- } catch (rdr::Exception &e) {
+ } catch (std::exception& e) {
vlog.error("%s", e.what());
return 1;
}
diff --git a/unix/xserver/hw/vnc/RFBGlue.cc b/unix/xserver/hw/vnc/RFBGlue.cc
index 2cbee35c..2295bee8 100644
--- a/unix/xserver/hw/vnc/RFBGlue.cc
+++ b/unix/xserver/hw/vnc/RFBGlue.cc
@@ -216,7 +216,7 @@ int vncIsTCPPortUsed(int port)
delete dummy.back();
dummy.pop_back();
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
return 1;
}
return 0;
diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc
index 7ad65d06..9c4486c8 100644
--- a/unix/xserver/hw/vnc/XserverDesktop.cc
+++ b/unix/xserver/hw/vnc/XserverDesktop.cc
@@ -38,7 +38,6 @@
#include <sys/utsname.h>
#include <network/Socket.h>
-#include <rfb/Exception.h>
#include <rfb/VNCServerST.h>
#include <rfb/LogWriter.h>
#include <rfb/Configuration.h>
@@ -195,7 +194,7 @@ void XserverDesktop::requestClipboard()
{
try {
server->requestClipboard();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::requestClipboard: %s",e.what());
}
}
@@ -204,7 +203,7 @@ void XserverDesktop::announceClipboard(bool available)
{
try {
server->announceClipboard(available);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::announceClipboard: %s",e.what());
}
}
@@ -213,7 +212,7 @@ void XserverDesktop::sendClipboardData(const char* data_)
{
try {
server->sendClipboardData(data_);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::sendClipboardData: %s",e.what());
}
}
@@ -232,7 +231,7 @@ void XserverDesktop::setDesktopName(const char* name)
{
try {
server->setName(name);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setDesktopName: %s",e.what());
}
}
@@ -267,7 +266,7 @@ void XserverDesktop::setCursor(int width, int height, int hotX, int hotY,
try {
server->setCursor(width, height, Point(hotX, hotY), cursorData);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setCursor: %s",e.what());
}
@@ -278,7 +277,7 @@ void XserverDesktop::setCursorPos(int x, int y, bool warped)
{
try {
server->setCursorPos(Point(x, y), warped);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::setCursorPos: %s",e.what());
}
}
@@ -287,7 +286,7 @@ void XserverDesktop::add_changed(const rfb::Region &region)
{
try {
server->add_changed(region);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::add_changed: %s",e.what());
}
}
@@ -296,7 +295,7 @@ void XserverDesktop::add_copied(const rfb::Region &dest, const rfb::Point &delta
{
try {
server->add_copied(dest, delta);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::add_copied: %s",e.what());
}
}
@@ -313,7 +312,7 @@ void XserverDesktop::handleSocketEvent(int fd, bool read, bool write)
return;
vlog.error("Cannot find file descriptor for socket event");
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::handleSocketEvent: %s",e.what());
}
}
@@ -406,7 +405,7 @@ void XserverDesktop::blockHandler(int* timeout)
int nextTimeout = Timer::checkTimeouts();
if (nextTimeout >= 0 && (*timeout == -1 || nextTimeout < *timeout))
*timeout = nextTimeout;
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("XserverDesktop::blockHandler: %s", e.what());
}
}
diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc
index b39366a8..ab4b28d3 100644
--- a/unix/xserver/hw/vnc/vncExtInit.cc
+++ b/unix/xserver/hw/vnc/vncExtInit.cc
@@ -274,7 +274,7 @@ void vncExtensionInit(void)
vncHooksInit(scr);
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncExtInit: %s\n",e.what());
}
@@ -288,7 +288,7 @@ void vncExtensionClose(void)
delete desktop[scr];
desktop[scr] = nullptr;
}
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncExtInit: %s\n",e.what());
}
}
@@ -348,7 +348,7 @@ int vncConnectClient(const char *addr, int viewOnly)
if (strlen(addr) == 0) {
try {
desktop[0]->disconnectClients();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Disconnecting all clients: %s", e.what());
return -1;
}
@@ -365,7 +365,7 @@ int vncConnectClient(const char *addr, int viewOnly)
vlog.info("Reverse connection: %s:%d%s", host.c_str(), port,
viewOnly ? " (view only)" : "");
desktop[0]->addClient(sock, true, (bool)viewOnly);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vlog.error("Reverse connection: %s", e.what());
return -1;
}
@@ -462,7 +462,7 @@ void vncPostScreenResize(int scrIdx, int success, int width, int height)
desktop[scrIdx]->setFramebuffer(width, height,
vncFbptr[scrIdx],
vncFbstride[scrIdx]);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncPostScreenResize: %s\n", e.what());
}
}
@@ -479,7 +479,7 @@ void vncRefreshScreenLayout(int scrIdx)
{
try {
desktop[scrIdx]->refreshScreenLayout();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncRefreshScreenLayout: %s\n", e.what());
}
}
@@ -488,7 +488,7 @@ uint64_t vncGetMsc(int scrIdx)
{
try {
return desktop[scrIdx]->getMsc();
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncGetMsc: %s\n", e.what());
}
}
@@ -497,7 +497,7 @@ void vncQueueMsc(int scrIdx, uint64_t id, uint64_t msc)
{
try {
desktop[scrIdx]->queueMsc(id, msc);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncQueueMsc: %s\n", e.what());
}
}
@@ -506,7 +506,7 @@ void vncAbortMsc(int scrIdx, uint64_t id)
{
try {
desktop[scrIdx]->abortMsc(id);
- } catch (rdr::Exception& e) {
+ } catch (std::exception& e) {
vncFatalError("vncAbortMsc: %s\n", e.what());
}
}