FreeBSD build error - workaround patch

Michael Neumann <mneuma2s-HLWg83l9DMevRySba1qPKDqC5zpoNJ7mdz/[email protected]>
Newsgroups gmane.network.silc.devel
Message-ID <[email protected]>
Hi,

i tried to compile the silc client 1.1 beta 6 in my FreeBSD machine.
Happens to not like the glibc-specific timezone variable. This patch
works for me and i don't know what'll happen when gmtime fails.

$ diff -u lib/silcutil/silctime.c.org lib/silcutil/silctime.c
--- lib/silcutil/silctime.c.org Tue May  8 22:21:17 2007
+++ lib/silcutil/silctime.c     Thu May 31 02:03:15 2007
@@ -136,11 +136,21 @@
                          _timezone % 3600);
 #else
 #if defined(HAVE_TZSET)
+#ifdef __FreeBSD__
+  ret_time->utc_east   = time->tm_gmtoff > 0 ? 1 : 0;
+  time = gmtime(&timeval);
+  if(!time)
+    return FALSE;
+  ret_time->utc_hour   = time->tm_hour;
+  ret_time->utc_minute = time->tm_min;
+#else
   ret_time->utc_east   = timezone < 0 ? 1 : 0;
   ret_time->utc_hour   = (ret_time->utc_east ? (-(timezone)) / 3600 :
                          timezone / 3600);
   ret_time->utc_minute = (ret_time->utc_east ? (-(timezone)) % 3600 :
                          timezone % 3600);
+  ret_time->utc_minute /= 60;
+#endif /* __FreeBSD__ */
 #endif /* HAVE_TZSET */
 #endif /* SILC_WIN32 */
_______________________________________________________________________
Info:    https://lists.silcnet.org/mailman/listinfo/silc-announce
Archive: https://lists.silcnet.org/pipermail/silc-announce
FAQ:     http://silcnet.org/support/faq/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.