MDEV-22615 system_time_zone may be incorrectly reported as "unknown".

TIME_ZONE_ID_UNKNOWN return code from GetDynamicTimeZoneInformation()
does not mean failure.

It only means, daylight saving dates in the returned strct are not valid.
TIME_ZONE_ID_INVALID means failure, in this case  "unknown" should be returned
This commit is contained in:
Vladislav Vaintroub 2020-05-18 16:39:38 +02:00
parent 5e12aca57f
commit 4869e7f4a8

View file

@ -4176,7 +4176,7 @@ static void get_win_tzname(char* buf, size_t size)
{0,0}
};
DYNAMIC_TIME_ZONE_INFORMATION tzinfo;
if (GetDynamicTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_UNKNOWN)
if (GetDynamicTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_INVALID)
{
strncpy(buf, "unknown", size);
return;