From 495df6d6ec47b2dead89870c16d2642f2d0e082d Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 24 Feb 2016 09:42:12 +0100 Subject: [PATCH] Readded read timezone from link. --- winpr/libwinpr/timezone/timezone.c | 61 +++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) 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);