Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ conf.set10(
),
description: 'Does struct opal_key have a key_type field?'
)
conf.set(
'HAVE_TM_GMTOFF',
cc.compiles(
'''
#include <time.h>
int main(void) {
struct tm tm;
tm.tm_gmtoff = 1;
}
''',
name: 'tm_gmtoff'
),
description: 'Does struct tm have a tm_gmtoff field?'
)

if cc.has_function_attribute('fallthrough')
conf.set('fallthrough', '__attribute__((__fallthrough__))')
Expand Down
6 changes: 3 additions & 3 deletions plugins/wdc/wdc-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ int wdc_UtilsGetTime(PUtilsTimeInfo timeInfo)
timeInfo->second = currTimeInfo.tm_sec;
timeInfo->msecs = 0;
timeInfo->isDST = currTimeInfo.tm_isdst;
#if (defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(__MUSL__)) || defined(__FreeBSD__)
#ifdef HAVE_TM_GMTOFF
timeInfo->zone = -currTimeInfo.tm_gmtoff / 60;
#else
#else /* HAVE_TM_GMTOFF */
timeInfo->zone = -1 * (timezone / SECONDS_IN_MIN);
#endif
#endif /* HAVE_TM_GMTOFF */

return WDC_STATUS_SUCCESS;
}
Expand Down