Re: FreeBSD build error - workaround patch

Pekka Riikonen <[email protected]>
Newsgroups gmane.network.silc.devel
Message-ID <[email protected]>
On Thu, 31 May 2007, Michael Neumann wrote:

: Didn't take a closer look on silctime.h yesterday. This one should be 
: correct now. I also missed to mention, that you forgot to divide 
: utc_minute to get minutes instead of seconds.
: 
: $ 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 15:20:44 2007
: @@ -134,13 +134,29 @@
:                           _timezone / 3600);
:    ret_time->utc_minute = (ret_time->utc_east ? (-(_timezone)) % 3600 :
:                           _timezone % 3600);
: +  ret_time->utc_minute /= 60;
:  #else
:  #if defined(HAVE_TZSET)
: +#ifdef __FreeBSD__
: +  ret_time->utc_east   = time->tm_gmtoff > 0 ? 1 : 0;
: +  if(ret_time->utc_east == 1)
: +  {
: +    ret_time->utc_hour   = time->tm_gmtoff / 3600;
: +    ret_time->utc_minute = (time->tm_gmtoff % 3600) / 60;
: +  }
: +  else
: +  {
: +    ret_time->utc_hour   = (-time->tm_gmtoff) / 3600;
: +    ret_time->utc_minute = ((-time->tm_gmtoff) % 3600) / 60;
: +  }
: +#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 */
: 
Thanks for the patches.  I have fixed this a bit differently in CVS.  We  
now check for timezone, tm_gmtoff, __tm_gmtoff and __tm_gmtoff__ and use  
whatever is available, instead of checking for FreeBSD specifically.

	Pekka
________________________________________________________________________
 Pekka Riikonen                                 priikone at silcnet.org
 Secure Internet Live Conferencing (SILC)       http://silcnet.org/
_______________________________________________________________________
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.