summaryrefslogtreecommitdiff
path: root/src/log.cpp
diff options
context:
space:
mode:
authorOthmar Gsenger <otti@anytun.org>2009-01-16 00:47:19 +0000
committerOthmar Gsenger <otti@anytun.org>2009-01-16 00:47:19 +0000
commite0d296c0441ab66086017081f1faaca699460a95 (patch)
tree2e5ac42c31046d3fccb615eef87c54040cf57dc7 /src/log.cpp
parentremoved old files from vc++ project file (diff)
changed strerr to boost::system::error
this might need some testing
Diffstat (limited to 'src/log.cpp')
-rw-r--r--src/log.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/log.cpp b/src/log.cpp
index ccced0b..65496d3 100644
--- a/src/log.cpp
+++ b/src/log.cpp
@@ -31,7 +31,7 @@
#include <iostream>
#include <string>
-
+#include <boost/system/system_error.hpp>
#include "log.h"
#include "threadUtils.hpp"
@@ -53,18 +53,9 @@ std::ostream& operator<<(std::ostream& stream, LogGpgError const& value)
#endif
std::ostream& operator<<(std::ostream& stream, LogErrno const& value)
{
- char buf[STERROR_TEXT_MAX];
- buf[0] = 0;
- char* errStr;
-// this really sucks, g++ seems to unconditionally define _GNU_SOURCE
-// and undefining it breaks the build...
-#ifdef _GNU_SOURCE
- errStr = strerror_r(value.err_, buf, STERROR_TEXT_MAX);
-#else
- strerror_r(value.err_, buf, STERROR_TEXT_MAX);
- errStr = buf;
-#endif
- return stream << errStr;
+// boost::system::system_error err(boost::system::error_code(value.err_,boost::system::get_system_category()));
+ boost::system::system_error err(boost::system::error_code(value.err_,boost::system::get_posix_category()));
+ return stream << err.what();
}
LogStringBuilder::LogStringBuilder(LogStringBuilder const& src) : log(src.log), prio(src.prio)