diff --git a/winpr/libwinpr/timezone/timezone.c b/winpr/libwinpr/timezone/timezone.c index bce7d2adf..534b92ac6 100644 --- a/winpr/libwinpr/timezone/timezone.c +++ b/winpr/libwinpr/timezone/timezone.c @@ -1515,6 +1515,62 @@ static char* freerdp_read_unix_timezone_identifier_from_file(FILE* fp) return tzid; } +static char* freerdp_get_timezone_from_link(void) +{ + const char* links[] = + { + "/etc/localtime", + "/etc/TZ" + }; + size_t x; + ssize_t len; + char buf[1024]; + char* tzid = NULL; + + /* + * On linux distros such as Redhat or Archlinux, a symlink at /etc/localtime + * will point to /usr/share/zoneinfo/region/place where region/place could be + * America/Montreal for example. + * Some distributions do have to symlink at /etc/TZ. + */ + + for (x=0; xBias = 0; #endif WLog_DBG(TAG, "tzname[std]: %s, tzname[dst]: %s, timezone: %ld, Daylight: %d", - tzname[0], tzname[1], timezone, daylight); + tzname[0], tzname[1], timezone, daylight); dtz = freerdp_detect_windows_time_zone(tz->Bias);