setting_helpers: write /etc/timezone for better compatibility

Origin commit data
------------------
Branch: ni/coolstream
Commit: c9c3c01e92
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-10-11 (Sat, 11 Oct 2014)


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

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2014-10-11 21:58:45 +02:00
parent a6c82ba46c
commit d60e14c744

View File

@@ -509,6 +509,12 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data)
perror("unlink failed");
if (symlink(cmd.c_str(), "/etc/localtime"))
perror("symlink failed");
/* for yocto tzdata compatibility */
FILE *f = fopen("/etc/timezone", "w");
if (f) {
fprintf(f, "%s\n", zone.c_str());
fclose(f);
}
#if 0
cmd = ":" + zone;
setenv("TZ", cmd.c_str(), 1);