aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2020-03-26 08:50:17 +0100
committerPierre Ossman <ossman@cendio.se>2020-03-26 08:50:17 +0100
commit6b938e676baf3d79a05ae1dc9173181bb76a7494 (patch)
tree4bc6b8c9ef35ac1a76c3ca4aec27c4ec6feabb77 /common
parentb0875cadc20e36c19490c5d8effd64c30e2d901b (diff)
downloadtigervnc-6b938e676baf3d79a05ae1dc9173181bb76a7494.tar.gz
tigervnc-6b938e676baf3d79a05ae1dc9173181bb76a7494.zip
Include error code in getaddrinfo() exceptions
Diffstat (limited to 'common')
-rw-r--r--common/rdr/Exception.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/common/rdr/Exception.cxx b/common/rdr/Exception.cxx
index f4e23836..382fea3d 100644
--- a/common/rdr/Exception.cxx
+++ b/common/rdr/Exception.cxx
@@ -63,9 +63,18 @@ GAIException::GAIException(const char* s, int err)
len-1-strlen(str_), 0, 0);
delete [] currStr;
#else
- //FIXME: perhaps print the error number (NNNN)
strncat(str_, gai_strerror(err), len-1-strlen(str_));
#endif
+ strncat(str_, " (", len-1-strlen(str_));
+ char buf[20];
+#ifdef WIN32
+ if (err < 0)
+ sprintf(buf, "%x", err);
+ else
+#endif
+ sprintf(buf,"%d",err);
+ strncat(str_, buf, len-1-strlen(str_));
+ strncat(str_, ")", len-1-strlen(str_));
}
SystemException::SystemException(const char* s, int err_)