diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 29bdf9844..dab1943ac 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -64,7 +64,7 @@ #include #include #include -#include + #include #include @@ -619,7 +619,6 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void *Data) bool found = false; std::string name, zone; printf("CTZChangeNotifier::changeNotify: %s\n", (char *) Data); - std::string zoneinfo = TARGET_PREFIX "/share/zoneinfo/" + zone; xmlDocPtr parser = parseXmlFile("/etc/timezone.xml"); if (parser != NULL) @@ -639,10 +638,8 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void *Data) const char *zptr = xmlGetAttribute(search, "zone"); if (zptr) zone = zptr; - if (!access(zoneinfo.c_str(), R_OK)) + if (!access(TARGET_PREFIX "/share/zoneinfo/" + zone, R_OK)) found = true; - else - dprintf(DEBUG_NORMAL, "[CTZChangeNotifier] [%s - %d] %s not found\n", __func__, __LINE__, zoneinfo.c_str()); break; } } @@ -653,7 +650,7 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void *Data) if (found) { printf("Timezone: %s -> %s\n", name.c_str(), zone.c_str()); - std::string cmd = zoneinfo; + std::string cmd = TARGET_PREFIX "/share/zoneinfo/" + zone; printf("symlink %s to /etc/localtime\n", cmd.c_str()); if (unlink("/etc/localtime")) perror("unlink failed");