]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Read timezone from gettimeofday() to not have to rely on an globally set timezone...
authorBernhard Froehlich <decke@bluelife.at>
Sat, 4 May 2013 12:24:04 +0000 (14:24 +0200)
committerBernhard Froehlich <decke@bluelife.at>
Sat, 4 May 2013 12:24:04 +0000 (14:24 +0200)
src/htsp_server.c

index 1890d01e33efacf76802b433c74c31d557052d4b..3cfa6a19bae311eb219cf392b7ff58bf5128a1d2 100644 (file)
@@ -795,13 +795,14 @@ htsp_method_getSysTime(htsp_connection_t *htsp, htsmsg_t *in)
 {
   htsmsg_t *out;
   struct timeval tv;
+  struct timezone tz;
 
-  if(gettimeofday(&tv, NULL) == -1)
+  if(gettimeofday(&tv, &tz) == -1)
     return htsp_error("Unable to get system time"); 
 
   out = htsmsg_create_map();
   htsmsg_add_s32(out, "time", tv.tv_sec);
-  htsmsg_add_s32(out, "timezone", timezone / 60);
+  htsmsg_add_s32(out, "timezone", tz.tz_minuteswest / 60);
   return out;
 }