{
htsmsg_t *out;
struct timeval tv;
- struct timezone tz;
- if(gettimeofday(&tv, &tz) == -1)
+ if(gettimeofday(&tv, NULL) == -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", tz.tz_minuteswest);
+ htsmsg_add_s32(out, "timezone", timezone / 60);
return out;
}
#include <errno.h>
#include <syslog.h>
#include <limits.h>
+#include <time.h>
#include <pwd.h>
#include <grp.h>
uint32_t adapter_mask = 0xffffffff;
int crash = 0;
+ // make sure the timezone is set
+ tzset();
+
while((c = getopt(argc, argv, "Aa:fu:g:c:Chdr:j:s")) != -1) {
switch(c) {
case 'a':