summaryrefslogtreecommitdiff
path: root/klm/util/exception.cc
diff options
context:
space:
mode:
Diffstat (limited to 'klm/util/exception.cc')
-rw-r--r--klm/util/exception.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/klm/util/exception.cc b/klm/util/exception.cc
index dd337a76..de6dd43c 100644
--- a/klm/util/exception.cc
+++ b/klm/util/exception.cc
@@ -24,7 +24,12 @@ const char *HandleStrerror(const char *ret, const char *buf) {
ErrnoException::ErrnoException() throw() : errno_(errno) {
char buf[200];
buf[0] = 0;
+#ifdef sun
+ const char *add = strerror(errno);
+#else
const char *add = HandleStrerror(strerror_r(errno, buf, 200), buf);
+#endif
+
if (add) {
*this << add << ' ';
}