diff options
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tx/TXDialog.h | 4 | ||||
-rw-r--r-- | unix/vncconfig/vncconfig.cxx | 6 | ||||
-rw-r--r-- | unix/x0vncserver/XDesktop.cxx | 7 | ||||
-rw-r--r-- | unix/x0vncserver/x0vncserver.cxx | 6 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/RFBGlue.cc | 2 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/XserverDesktop.cc | 41 | ||||
-rw-r--r-- | unix/xserver/hw/vnc/vncExtInit.cc | 38 |
7 files changed, 52 insertions, 52 deletions
diff --git a/unix/tx/TXDialog.h b/unix/tx/TXDialog.h index 3a22fd07..6533377f 100644 --- a/unix/tx/TXDialog.h +++ b/unix/tx/TXDialog.h @@ -28,6 +28,8 @@ #ifndef __TXDIALOG_H__ #define __TXDIALOG_H__ +#include <rdr/Exception.h> + #include "TXWindow.h" #include <errno.h> @@ -63,7 +65,7 @@ public: FD_ZERO(&rfds); FD_SET(ConnectionNumber(dpy), &rfds); int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, nullptr); - if (n < 0) throw rdr::SocketException("select", errno); + if (n < 0) throw rdr::socket_error("select", errno); } } return true; diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx index 1498bbdb..ecc6eddc 100644 --- a/unix/vncconfig/vncconfig.cxx +++ b/unix/vncconfig/vncconfig.cxx @@ -330,13 +330,13 @@ int main(int argc, char** argv) FD_ZERO(&rfds); FD_SET(ConnectionNumber(dpy), &rfds); int n = select(FD_SETSIZE, &rfds, nullptr, nullptr, tvp); - if (n < 0) throw rdr::SocketException("select", errno); + if (n < 0) throw rdr::socket_error("select", errno); } XCloseDisplay(dpy); - } catch (rdr::Exception &e) { - vlog.error("%s", e.str()); + } catch (std::exception& e) { + vlog.error("%s", e.what()); } return 0; diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx index fd19dd71..b4e795ef 100644 --- a/unix/x0vncserver/XDesktop.cxx +++ b/unix/x0vncserver/XDesktop.cxx @@ -31,7 +31,6 @@ #include <network/Socket.h> #include <rfb/LogWriter.h> -#include <rfb/Exception.h> #include <x0vncserver/XDesktop.h> @@ -98,7 +97,7 @@ XDesktop::XDesktop(Display* dpy_, Geometry *geometry_) if (!XkbQueryExtension(dpy, &xkbOpcode, &xkbEventBase, &xkbErrorBase, &major, &minor)) { vlog.error("XKEYBOARD extension not present"); - throw Exception(); + throw std::runtime_error("XKEYBOARD extension not present"); } XkbSelectEvents(dpy, XkbUseCoreKbd, XkbIndicatorStateNotifyMask, @@ -1049,8 +1048,8 @@ bool XDesktop::setCursor() try { server->setCursor(cim->width, cim->height, Point(cim->xhot, cim->yhot), cursorData); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::setCursor: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::setCursor: %s",e.what()); } delete [] cursorData; diff --git a/unix/x0vncserver/x0vncserver.cxx b/unix/x0vncserver/x0vncserver.cxx index fce32c74..03f31576 100644 --- a/unix/x0vncserver/x0vncserver.cxx +++ b/unix/x0vncserver/x0vncserver.cxx @@ -436,7 +436,7 @@ int main(int argc, char** argv) vlog.debug("Interrupted select() system call"); continue; } else { - throw rdr::SocketException("select", errno); + throw rdr::socket_error("select", errno); } } @@ -475,8 +475,8 @@ int main(int argc, char** argv) } } - } catch (rdr::Exception &e) { - vlog.error("%s", e.str()); + } 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 e3bc57d8..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,8 +194,8 @@ void XserverDesktop::requestClipboard() { try { server->requestClipboard(); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::requestClipboard: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::requestClipboard: %s",e.what()); } } @@ -204,8 +203,8 @@ void XserverDesktop::announceClipboard(bool available) { try { server->announceClipboard(available); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::announceClipboard: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::announceClipboard: %s",e.what()); } } @@ -213,8 +212,8 @@ void XserverDesktop::sendClipboardData(const char* data_) { try { server->sendClipboardData(data_); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::sendClipboardData: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::sendClipboardData: %s",e.what()); } } @@ -232,8 +231,8 @@ void XserverDesktop::setDesktopName(const char* name) { try { server->setName(name); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::setDesktopName: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::setDesktopName: %s",e.what()); } } @@ -267,8 +266,8 @@ void XserverDesktop::setCursor(int width, int height, int hotX, int hotY, try { server->setCursor(width, height, Point(hotX, hotY), cursorData); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::setCursor: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::setCursor: %s",e.what()); } delete [] cursorData; @@ -278,8 +277,8 @@ void XserverDesktop::setCursorPos(int x, int y, bool warped) { try { server->setCursorPos(Point(x, y), warped); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::setCursorPos: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::setCursorPos: %s",e.what()); } } @@ -287,8 +286,8 @@ void XserverDesktop::add_changed(const rfb::Region ®ion) { try { server->add_changed(region); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::add_changed: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::add_changed: %s",e.what()); } } @@ -296,8 +295,8 @@ void XserverDesktop::add_copied(const rfb::Region &dest, const rfb::Point &delta { try { server->add_copied(dest, delta); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::add_copied: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::add_copied: %s",e.what()); } } @@ -313,8 +312,8 @@ void XserverDesktop::handleSocketEvent(int fd, bool read, bool write) return; vlog.error("Cannot find file descriptor for socket event"); - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::handleSocketEvent: %s",e.str()); + } catch (std::exception& e) { + vlog.error("XserverDesktop::handleSocketEvent: %s",e.what()); } } @@ -406,8 +405,8 @@ void XserverDesktop::blockHandler(int* timeout) int nextTimeout = Timer::checkTimeouts(); if (nextTimeout >= 0 && (*timeout == -1 || nextTimeout < *timeout)) *timeout = nextTimeout; - } catch (rdr::Exception& e) { - vlog.error("XserverDesktop::blockHandler: %s",e.str()); + } 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 073b07e2..e56e0db0 100644 --- a/unix/xserver/hw/vnc/vncExtInit.cc +++ b/unix/xserver/hw/vnc/vncExtInit.cc @@ -250,7 +250,7 @@ void vncExtensionInit(void) } if (!inetd && listeners.empty()) - throw rdr::Exception("No path or port configured for incoming connections"); + throw std::runtime_error("No path or port configured for incoming connections"); PixelFormat pf = vncGetPixelFormat(scr); @@ -274,8 +274,8 @@ void vncExtensionInit(void) vncHooksInit(scr); } - } catch (rdr::Exception& e) { - vncFatalError("vncExtInit: %s\n",e.str()); + } catch (std::exception& e) { + vncFatalError("vncExtInit: %s\n",e.what()); } vncRegisterBlockHandlers(); @@ -288,8 +288,8 @@ void vncExtensionClose(void) delete desktop[scr]; desktop[scr] = nullptr; } - } catch (rdr::Exception& e) { - vncFatalError("vncExtInit: %s\n",e.str()); + } catch (std::exception& e) { + vncFatalError("vncExtInit: %s\n",e.what()); } } @@ -348,8 +348,8 @@ int vncConnectClient(const char *addr, int viewOnly) if (strlen(addr) == 0) { try { desktop[0]->disconnectClients(); - } catch (rdr::Exception& e) { - vlog.error("Disconnecting all clients: %s",e.str()); + } catch (std::exception& e) { + vlog.error("Disconnecting all clients: %s", e.what()); return -1; } return 0; @@ -365,8 +365,8 @@ 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) { - vlog.error("Reverse connection: %s",e.str()); + } catch (std::exception& e) { + vlog.error("Reverse connection: %s", e.what()); return -1; } @@ -462,8 +462,8 @@ void vncPostScreenResize(int scrIdx, int success, int width, int height) desktop[scrIdx]->setFramebuffer(width, height, vncFbptr[scrIdx], vncFbstride[scrIdx]); - } catch (rdr::Exception& e) { - vncFatalError("vncPostScreenResize: %s\n", e.str()); + } catch (std::exception& e) { + vncFatalError("vncPostScreenResize: %s\n", e.what()); } } @@ -479,8 +479,8 @@ void vncRefreshScreenLayout(int scrIdx) { try { desktop[scrIdx]->refreshScreenLayout(); - } catch (rdr::Exception& e) { - vncFatalError("vncRefreshScreenLayout: %s\n", e.str()); + } catch (std::exception& e) { + vncFatalError("vncRefreshScreenLayout: %s\n", e.what()); } } @@ -488,8 +488,8 @@ uint64_t vncGetMsc(int scrIdx) { try { return desktop[scrIdx]->getMsc(); - } catch (rdr::Exception& e) { - vncFatalError("vncGetMsc: %s\n", e.str()); + } catch (std::exception& e) { + vncFatalError("vncGetMsc: %s\n", e.what()); } } @@ -497,8 +497,8 @@ void vncQueueMsc(int scrIdx, uint64_t id, uint64_t msc) { try { desktop[scrIdx]->queueMsc(id, msc); - } catch (rdr::Exception& e) { - vncFatalError("vncQueueMsc: %s\n", e.str()); + } catch (std::exception& e) { + vncFatalError("vncQueueMsc: %s\n", e.what()); } } @@ -506,8 +506,8 @@ void vncAbortMsc(int scrIdx, uint64_t id) { try { desktop[scrIdx]->abortMsc(id); - } catch (rdr::Exception& e) { - vncFatalError("vncAbortMsc: %s\n", e.str()); + } catch (std::exception& e) { + vncFatalError("vncAbortMsc: %s\n", e.what()); } } |