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
This commit is contained in:
Bernhard Miklautz
2016-02-23 16:25:05 +01:00
parent e6f013eac7
commit dd93fd2b3d

View File

@@ -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;