From 5cdea0c1454ba904be72c599a68fb4817c2c9e04 Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Tue, 23 Aug 2011 06:52:24 +0000 Subject: [PATCH] trunk/branch integration: VxWorks & Wince --- Foundation/src/LocalDateTime.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Foundation/src/LocalDateTime.cpp b/Foundation/src/LocalDateTime.cpp index 625cc01a1..e8349f505 100644 --- a/Foundation/src/LocalDateTime.cpp +++ b/Foundation/src/LocalDateTime.cpp @@ -289,14 +289,19 @@ void LocalDateTime::determineTzd(bool adjust) std::tm* broken = std::localtime(&epochTime); #endif if (!broken) throw Poco::SystemException("cannot get local time"); - _tzd = (Timezone::utcOffset() + ((broken->tm_isdst == 1) ? 3600 : 0)); + _tzd = (Timezone::utcOffset() + ((broken->tm_isdst == 1) ? 3600 : 0)); #else - std::tm broken; - if (!localtime_r(&epochTime, &broken)) - throw Poco::SystemException("cannot get local time"); - _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0)); + std::tm broken; +#if defined(POCO_VXWORKS) + if (localtime_r(&epochTime, &broken) != OK) + throw Poco::SystemException("cannot get local time"); +#else + if (!localtime_r(&epochTime, &broken)) + throw Poco::SystemException("cannot get local time"); #endif - adjustForTzd(); + _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0)); +#endif + adjustForTzd(); } else {