Skip to content

Commit 81c8f26

Browse files
bsdimpigaw
authored andcommitted
wdc: On FreeBSD, get the timezone the same as with real glibc
FreeBSD 15 and newer finally has the timezone variable (prior it that was a compat function leftover from 4BSD). Older versions are still supported. Both have tm_gmoff, which I've always preferred for better portability. Signed-off-by: Warner Losh <[email protected]>
1 parent aec85d9 commit 81c8f26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/wdc/wdc-utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ int wdc_UtilsGetTime(PUtilsTimeInfo timeInfo)
8181
timeInfo->second = currTimeInfo.tm_sec;
8282
timeInfo->msecs = 0;
8383
timeInfo->isDST = currTimeInfo.tm_isdst;
84-
#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)
84+
#if (defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)) || defined(__FreeBSD__)
8585
timeInfo->zone = -currTimeInfo.tm_gmtoff / 60;
8686
#else
8787
timeInfo->zone = -1 * (timezone / SECONDS_IN_MIN);

0 commit comments

Comments
 (0)