Project

General

Profile

Bug #148 » tzfix.2.patch

Geoffrey McRae -, 2010-05-13 05:46

View differences:

src/htsp.c (working copy)
721 721
{
722 722
  htsmsg_t *out;
723 723
  struct timeval tv;
724
  struct timezone tz;
725 724

  
726
  if(gettimeofday(&tv, &tz) == -1)
725
  if(gettimeofday(&tv, NULL) == -1)
727 726
    return htsp_error("Unable to get system time");
728 727

  
729 728
  out = htsmsg_create_map();
730 729
  htsmsg_add_s32(out, "time", tv.tv_sec);
731
  htsmsg_add_s32(out, "timezone", tz.tz_minuteswest);
730
  htsmsg_add_s32(out, "timezone", timezone / 60);
732 731
  return out;
733 732
}
734 733

  
src/main.c (working copy)
28 28
#include <errno.h>
29 29
#include <syslog.h>
30 30
#include <limits.h>
31
#include <time.h>
31 32

  
32 33
#include <pwd.h>
33 34
#include <grp.h>
......
244 245
  uint32_t adapter_mask = 0xffffffff;
245 246
  int crash = 0;
246 247

  
248
  // make sure the timezone is set
249
  tzset();
250

  
247 251
  while((c = getopt(argc, argv, "Aa:fu:g:c:Chdr:j:s")) != -1) {
248 252
    switch(c) {
249 253
    case 'a':
(2-2/2)