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/anytun.cpp | 3 +-- src/anytun.suo | Bin 35840 -> 35840 bytes src/log.cpp | 17 ++++------------- 3 files changed, 5 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/anytun.cpp b/src/anytun.cpp index eeafc6f..b5d7e14 100644 --- a/src/anytun.cpp +++ b/src/anytun.cpp @@ -451,6 +451,7 @@ int main(int argc, char* argv[]) #ifndef NOSIGNALCONTROLLER int ret = sig.run(); + return ret; #else receiver(&p); #endif @@ -479,8 +480,6 @@ int main(int argc, char* argv[]) if(connTo) delete connTo; */ - - return ret; } catch(std::runtime_error& e) { diff --git a/src/anytun.suo b/src/anytun.suo index 9468834..0099b24 100644 Binary files a/src/anytun.suo and b/src/anytun.suo differ 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