7183N/AFind timezone on Solaris without having systemd's timedated
7183N/A
7183N/AWill not be accepted upstream, since they refuse to support any API other
7183N/Athan timedated, so we'll need to provide timedated at some point.
7183N/A
7183N/A--- gnome-control-center-3.18.2/panels/datetime/cc-datetime-panel.c.~1~ 2015-09-21 07:59:31.000000000 +0000
7183N/A+++ gnome-control-center-3.18.2/panels/datetime/cc-datetime-panel.c 2016-10-20 23:49:51.988471652 +0000
7183N/A@@ -621,7 +621,29 @@ get_initial_timezone (CcDateTimePanel *s
7183N/A {
7183N/A const gchar *timezone;
7183N/A
7183N/A+#ifdef __sun // no support for systemd's timedated yet
7183N/A+ timezone = getenv("TZ");
7183N/A+ if (timezone == NULL || (strcmp(timezone, "localtime") == 0))
7183N/A+ {
7183N/A+ char linkbuf[PATH_MAX];
7183N/A+ ssize_t bufused;
7183N/A+ const char tzdir[] = "/usr/share/lib/zoneinfo/";
7183N/A+
7183N/A+ bufused = readlink("/etc/localtime", linkbuf, sizeof(linkbuf) - 1);
7183N/A+ if (bufused > (sizeof(tzdir) - 1))
7183N/A+ {
7183N/A+ char *p;
7183N/A+ linkbuf[bufused] = '\0';
7183N/A+ p = strstr(linkbuf, tzdir);
7183N/A+ if (p != NULL)
7183N/A+ {
7183N/A+ timezone = g_strdup(p + sizeof(tzdir) - 1);
7183N/A+ }
7183N/A+ }
7183N/A+ }
7183N/A+#else // use systemd
7183N/A timezone = timedate1_get_timezone (self->priv->dtm);
7183N/A+#endif
7183N/A
7183N/A if (timezone == NULL ||
7183N/A !cc_timezone_map_set_timezone (CC_TIMEZONE_MAP (self->priv->map), timezone))