mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 18:20:26 +01:00
#3274: Fix localtime_r for VxWorks 6.9 and later
This commit is contained in:
parent
d4ec18d503
commit
19b2c5b415
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user