diff --git a/client/hostinfo_unix.C b/client/hostinfo_unix.C index 407bb89469..488c08f10d 100644 --- a/client/hostinfo_unix.C +++ b/client/hostinfo_unix.C @@ -121,12 +121,20 @@ char* ip_addr_string(int ip_addr) { // Returns the number of seconds difference from UTC // int get_timezone( void ) { + tzset(); + // TODO: take daylight savings time into account +#ifdef __timezone + tz = __timezone; +#elif timezone + tz = timezone; +#else time_t cur_time; struct tm *time_data; cur_time = time(NULL); time_data = localtime( &cur_time ); return time_data->tm_gmtoff; +#endif } // Returns true if the host is currently running off battery power