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