+
+/*
+ * Attempt to guess the name of the time zone currently in use
+ * on the underlying host system.
+ */
+void guess_time_zone(void) {
+ FILE *fp;
+ char buf[PATH_MAX];
+
+ fp = popen(file_guesstimezone, "r");
+ if (fp) {
+ if (fgets(buf, sizeof buf, fp) && (strlen(buf) > 2)) {
+ buf[strlen(buf)-1] = 0;
+ safestrncpy(config.c_default_cal_zone, buf, sizeof config.c_default_cal_zone);
+ CtdlLogPrintf(CTDL_INFO, "Configuring timezone: %s\n", config.c_default_cal_zone);
+ }
+ fclose(fp);
+ }
+}
+
+