From: Bernhard Froehlich Date: Sat, 4 May 2013 12:24:04 +0000 (+0200) Subject: Read timezone from gettimeofday() to not have to rely on an globally set timezone... X-Git-Tag: v3.9~46^2~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf1c6ac55ad12e6f1fbb9d0b399d89f6245d1d54;p=thirdparty%2Ftvheadend.git Read timezone from gettimeofday() to not have to rely on an globally set timezone variable. --- diff --git a/src/htsp_server.c b/src/htsp_server.c index a4da32791..0261e5d43 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -845,13 +845,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; }