BEAST on FreeBSD: timezone



Hi!  I get this warning when building beast on FreeBSD 5.2:

sfitime.c:62: warning: assignment makes integer from pointer without a cast

(See code below.)  Later, make check fails to convert a numeric time
to a string and back to the same value (in testsfi.c:81), and I think
this warning is what causes that.

It seems that timezone is supposed to be an integer value, but FreeBSD
can't find the value (and neither can I).  Instead it find the
timezone that is a part of libc, which is a function, so using it as a
value will yield the pointer value to that function.

So, what are the timezone value supposed to come from?

void
_sfi_init_time (void)
{
  static gboolean initialized = FALSE;
  struct timeval tv = { 0, };
  time_t t;
  gint error;

  g_assert (initialized++ == FALSE);

  tzset ();
  error = gettimeofday (&tv, NULL);
  if (error)
    sfi_info ("gettimeofday() failed: %s", g_strerror (errno));
  t = tv.tv_sec + tv.tv_usec / 1000000;
  localtime (&t);
  gmt_diff = timezone;                 /* This is sfitime.c:62 */
  gmt_diff *= SFI_USEC_FACTOR;
}

-- 
Rasmus Kaj ----------------------------------------------- rasmus@kaj.se
 \                   An NT server can be run by an idiot, and usually is
  \------------------------------------- http://www.stacken.kth.se/~kaj/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]