setting_helpers: remove some hardcoded paths

Origin commit data
------------------
Branch: ni/coolstream
Commit: 56fb558f1c
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-11-23 (Mon, 23 Nov 2020)

Origin message was:
------------------
- setting_helpers: remove some hardcoded paths

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2020-11-23 21:28:37 +01:00
parent 232b816953
commit fd43034620

View File

@@ -610,7 +610,7 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data)
const char *zptr = xmlGetAttribute(search, "zone");
if(zptr)
zone = zptr;
if (!access("/usr/share/zoneinfo/" + zone, R_OK))
if (!access(DATADIR "/zoneinfo/" + zone, R_OK))
found = true;
break;
}
@@ -621,7 +621,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 = "/usr/share/zoneinfo/" + zone;
std::string cmd = DATADIR "/zoneinfo/" + zone;
printf("symlink %s to /etc/localtime\n", cmd.c_str());
if (unlink("/etc/localtime"))
perror("unlink failed");