slipperygrey
Well-known member
I found something that seems to work. The only drawback is that unlike tm->tm_gmtoff, the timezone variable does not accommodate for DST.
C:
diff --git a/contrib/timelord/timelord.c b/contrib/timelord/timelord.c
index 572d6555..6b0f01a2 100644
--- a/contrib/timelord/timelord.c
+++ b/contrib/timelord/timelord.c
@@ -243,7 +243,11 @@ int main( int ac, char **av )
exit( 1 );
}
- mtime = tv.tv_sec + EPOCH + tm->tm_gmtoff;
+#if defined (HAVE_STRUCT_TM_GMTOFF)
+ mtime = tv.tv_sec + EPOCH + tm->tm_gmtoff;
+#else /* HAVE_STRUCT_TM_GMTOFF */
+ mtime = tv.tv_sec + EPOCH - timezone;
+#endif /* HAVE_STRUCT_TM_GMTOFF */
}
else {
if (( tm = gmtime( &tv.tv_sec )) == 0 ) {
[2.2] Fall back to timezone when tm_gmtoff is unavailable by rdmark · Pull Request #195 · Netatalk/netatalk
On Solaris/OmniOS tm_gmtoff is not available in struct tm in time.h, unlike *BSD/Linux. https://www.gnu.org/software/libc/manual/html_node/Broken_002ddown-Time.html As a fallback, use timezone (als...
github.com