diff --git a/Foundation/src/LocalDateTime.cpp b/Foundation/src/LocalDateTime.cpp index 720f41a4d2..487a2b325e 100644 --- a/Foundation/src/LocalDateTime.cpp +++ b/Foundation/src/LocalDateTime.cpp @@ -270,7 +270,7 @@ void LocalDateTime::determineTzd(bool adjust) _tzd = (Timezone::utcOffset() + ((broken->tm_isdst == 1) ? 3600 : 0)); #else std::tm broken; -#if defined(POCO_VXWORKS) +#if defined(POCO_VXWORKS) && (defined(_VXWORKS_COMPATIBILITY_MODE) || (defined(_WRS_VXWORKS_MAJOR) && ((_WRS_VXWORKS_MAJOR < 6) || ((_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR < 9))))) if (localtime_r(&epochTime, &broken) != OK) throw Poco::SystemException("cannot get local time"); #else @@ -280,6 +280,7 @@ void LocalDateTime::determineTzd(bool adjust) _tzd = (Timezone::utcOffset() + ((broken.tm_isdst == 1) ? 3600 : 0)); #endif adjustForTzd(); + } else { diff --git a/Foundation/src/Timezone_VX.cpp b/Foundation/src/Timezone_VX.cpp index 18339bffab..05c4cb2b15 100644 --- a/Foundation/src/Timezone_VX.cpp +++ b/Foundation/src/Timezone_VX.cpp @@ -35,7 +35,11 @@ int Timezone::dst() { std::time_t now = std::time(NULL); struct std::tm t; +#if defined(_VXWORKS_COMPATIBILITY_MODE) || (defined(_WRS_VXWORKS_MAJOR) && ((_WRS_VXWORKS_MAJOR < 6) || ((_WRS_VXWORKS_MAJOR == 6) && (_WRS_VXWORKS_MINOR < 9)))) if (localtime_r(&now, &t) != OK) +#else + if (!localtime_r(&now, &t)) +#endif throw Poco::SystemException("cannot get local time DST offset"); return t.tm_isdst == 1 ? 3600 : 0; }