From e0d296c0441ab66086017081f1faaca699460a95 Mon Sep 17 00:00:00 2001 From: Othmar Gsenger Date: Fri, 16 Jan 2009 00:47:19 +0000 Subject: changed strerr to boost::system::error this might need some testing --- src/log.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/log.cpp') 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 #include - +#include #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) -- cgit v1.2.3