diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-08-21 11:53:46 +0200 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2009-08-21 11:53:46 +0200 |
| commit | 3b755b060d094e5a2fef620fafbd237196054540 (patch) | |
| tree | fb6105a9d32966665b52324f0ede8cef47070e48 /lib | |
| parent | 3c5de611fbae9f98ef2613187a96bd8e048cea47 (diff) | |
| download | enigma2-3b755b060d094e5a2fef620fafbd237196054540.tar.gz enigma2-3b755b060d094e5a2fef620fafbd237196054540.zip | |
epgcache.cpp: fix restoring the timezone after mhwepg read
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dvb/epgcache.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp index 4ea47963..f80e1775 100644 --- a/lib/dvb/epgcache.cpp +++ b/lib/dvb/epgcache.cpp @@ -2811,6 +2811,7 @@ void eEPGCache::channel_data::timeMHW2DVB( int minutes, u_char *return_time) void eEPGCache::channel_data::timeMHW2DVB( u_char day, u_char hours, u_char minutes, u_char *return_time) // For date plus time of day { + char tz_saved[1024]; // Remove offset in mhw time. __u8 local_hours = hours; if ( hours >= 16 ) @@ -2823,6 +2824,8 @@ void eEPGCache::channel_data::timeMHW2DVB( u_char day, u_char hours, u_char minu time_t dt = ::time(0); char *old_tz = getenv( "TZ" ); + if (old_tz) + strcpy(tz_saved, old_tz); putenv("TZ=CET-1CEST,M3.5.0/2,M10.5.0/3"); tzset(); @@ -2845,7 +2848,7 @@ void eEPGCache::channel_data::timeMHW2DVB( u_char day, u_char hours, u_char minu if ( old_tz == NULL ) unsetenv( "TZ" ); else - putenv( old_tz ); + setenv("TZ", tz_saved, 1); tzset(); // Calculate MJD according to annex in ETSI EN 300 468 |
