Merge remote-tracking branch 'origin/topic/timw/windows-gmtoff'

* origin/topic/timw/windows-gmtoff:
  Skip setting tm_gmtoff on Windows
This commit is contained in:
Tim Wojtulewicz 2025-10-10 09:19:40 -07:00
commit 8c9a35fb73
3 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,11 @@
8.1.0-dev.664 | 2025-10-10 09:19:40 -0700
* Skip setting tm_gmtoff on Windows (Tim Wojtulewicz, Corelight)
tm_gmtoff is a POSIX extension to the tm struct that Windows doesn't
support it. It doesn't appear to change the output from the btest,
so we can just skip it.
8.1.0-dev.662 | 2025-10-10 12:52:02 +0200
* Bump CI to freebsd-13.5 (Benjamin Bannier, Corelight)

View file

@ -1 +1 @@
8.1.0-dev.662
8.1.0-dev.664

View file

@ -33,9 +33,12 @@ double time_from_lanman(uint32_t smb_time, uint32_t smb_date, uint16_t tz)
lTime.tm_year = ((smb_date >> 9) & 0x7f) + 80;
lTime.tm_isdst = -1;
#ifndef _MSC_VER
// The timezone passed in the data is the number of minutes from UTC, while
// tm_gmtoff is the number of seconds east of UTC. Adjust for that.
// tm_gmtoff is the number of seconds east of UTC. Adjust for that. This field
// is a POSIX extension that Windows doesn't support.
lTime.tm_gmtoff = static_cast<long>(tz) * 60;
#endif
return timegm(&lTime);
}