diff --git a/winixd/core/filelog.cpp b/winixd/core/filelog.cpp index f5844b5..717ae06 100644 --- a/winixd/core/filelog.cpp +++ b/winixd/core/filelog.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2018, Tomasz Sowa + * Copyright (c) 2018-2019, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -95,6 +95,7 @@ PT::Date FileLog::get_local_date(const PT::Date & date) { if( time_zones ) { + Lock lock(synchro); TimeZone * tz = time_zones->GetZone(log_time_zone_id); if( tz ) diff --git a/winixd/core/log.cpp b/winixd/core/log.cpp index 0abd1d5..0b22d0c 100644 --- a/winixd/core/log.cpp +++ b/winixd/core/log.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2008-2018, Tomasz Sowa + * Copyright (c) 2008-2019, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,7 +77,7 @@ void Log::PrintDate(const PT::Date & date) FileLog * winix_file_log = dynamic_cast(file_log); if( winix_file_log ) - (*this) << winix_file_log->get_local_date(date); + (*this) << winix_file_log->get_local_date(date); // synchronization is made in get_local_date else (*this) << date; } @@ -250,17 +250,18 @@ return *this; } -Log & Log::SystemErr(int err) -{ - (*this) << "errno: " << err; - - const char * err_msg = strerror(err); - - if( err_msg ) - (*this) << " (" << err_msg << ")"; - - return *this; -} +//Log & Log::SystemErr(int err) +//{ +// (*this) << "errno: " << err; +// +// // strerror is not thread safe and we now use Log in each thread +// const char * err_msg = strerror(err); +// +// if( err_msg ) +// (*this) << " (" << err_msg << ")"; +// +// return *this; +//} diff --git a/winixd/core/log.h b/winixd/core/log.h index ed4c20f..f016db6 100644 --- a/winixd/core/log.h +++ b/winixd/core/log.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2008-2018, Tomasz Sowa + * Copyright (c) 2008-2019, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -91,7 +91,7 @@ public: virtual Log & LogBinary(const char * blob, size_t blob_len); virtual Log & LogBinary(const std::string & blob); - virtual Log & SystemErr(int err); + //virtual Log & SystemErr(int err); private: