From dd93fd2b3de7bef3f4faebfe04448344a0a5ab88 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Tue, 23 Feb 2016 16:25:05 +0100 Subject: [PATCH] timezon: add support for tz package Some distributions don't use /etc/localtime but /etc/TZ instead. If /etc/localtime isn't find try this. For details see #2818 --- libfreerdp/locale/timezone.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libfreerdp/locale/timezone.c b/libfreerdp/locale/timezone.c index 573504956..a37b9ea8f 100644 --- a/libfreerdp/locale/timezone.c +++ b/libfreerdp/locale/timezone.c @@ -1567,9 +1567,11 @@ char* freerdp_get_unix_timezone_identifier() * 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. */ - if ((len = readlink("/etc/localtime", buf, sizeof(buf) - 1)) != -1) + if ((len = readlink("/etc/localtime", buf, sizeof(buf) - 1)) != -1 || + (len = readlink("/etc/TZ", buf, sizeof(buf) - 1)) != -1) { int num = 0; int pos = len;