From 72210b2cdb433f1ec5845e3579f54e4f09780660 Mon Sep 17 00:00:00 2001 From: Bernhard Froehlich Date: Sat, 4 May 2013 14:24:04 +0200 Subject: [PATCH] Read timezone from gettimeofday() to not have to rely on an globally set timezone variable. --- src/htsp_server.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/htsp_server.c b/src/htsp_server.c index 1890d01e..3cfa6a19 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -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; }