diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-09-10 16:55:32 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-10-09 13:37:08 +0200 |
commit | 40df30d258ebfd24a447fababc649867c24513d8 (patch) | |
tree | e29c3abaac640eb1cfe951cae4ce4fe6896c8029 /vncviewer/ServerDialog.cxx | |
parent | 56b3460aa318b650f12833ba119fa6decb930148 (diff) | |
download | tigervnc-40df30d258ebfd24a447fababc649867c24513d8.tar.gz tigervnc-40df30d258ebfd24a447fababc649867c24513d8.zip |
Split SystemException to handle Windows
Windows has (at least) two error namespaces, both errno and
GetLastResult(). These overlap, so it is important we keep track of
which one we are dealing with.
To make things extra problematic, the BSD socket API normally uses
errno, but on Windows it has been mapped in to the GetLastResult()
namespace.
Try to keep better control of this by using separate classes for the
namespaces.
Diffstat (limited to 'vncviewer/ServerDialog.cxx')
-rw-r--r-- | vncviewer/ServerDialog.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vncviewer/ServerDialog.cxx b/vncviewer/ServerDialog.cxx index 67082a9e..8622fff1 100644 --- a/vncviewer/ServerDialog.cxx +++ b/vncviewer/ServerDialog.cxx @@ -359,7 +359,7 @@ void ServerDialog::loadServerHistory() return; } std::string msg = format(_("Could not open \"%s\""), filepath); - throw rdr::SystemException(msg.c_str(), errno); + throw rdr::PosixException(msg.c_str(), errno); } int lineNr = 0; @@ -375,7 +375,7 @@ void ServerDialog::loadServerHistory() fclose(f); std::string msg = format(_("Failed to read line %d in " "file \"%s\""), lineNr, filepath); - throw rdr::SystemException(msg.c_str(), errno); + throw rdr::PosixException(msg.c_str(), errno); } int len = strlen(line); @@ -431,7 +431,7 @@ void ServerDialog::saveServerHistory() FILE* f = fopen(filepath, "w+"); if (!f) { std::string msg = format(_("Could not open \"%s\""), filepath); - throw rdr::SystemException(msg.c_str(), errno); + throw rdr::PosixException(msg.c_str(), errno); } // Save the last X elements to the config file. |