aboutsummaryrefslogtreecommitdiff
path: root/lib/dvb/epgcache.cpp
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-02-16 17:09:54 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2007-02-16 17:09:54 +0000
commitf42469ee4922272eab2c5718fcc3c27894ededf5 (patch)
tree352b9171bf963debf7c110fe91b898fe7b918807 /lib/dvb/epgcache.cpp
parenteb93fe8746d1b2b61f4c7bffa74a6625c9cc0705 (diff)
downloadenigma2-f42469ee4922272eab2c5718fcc3c27894ededf5.tar.gz
enigma2-f42469ee4922272eab2c5718fcc3c27894ededf5.zip
erase /hdd/epg.dat after read
Diffstat (limited to 'lib/dvb/epgcache.cpp')
-rw-r--r--lib/dvb/epgcache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/dvb/epgcache.cpp b/lib/dvb/epgcache.cpp
index 1428cc7c..acdc9a9d 100644
--- a/lib/dvb/epgcache.cpp
+++ b/lib/dvb/epgcache.cpp
@@ -861,8 +861,9 @@ void eEPGCache::thread()
void eEPGCache::load()
{
- singleLock s(cache_lock);
- FILE *f = fopen("/hdd/epg.dat", "r");
+ unlink("/hdd/epg.dat.$$$");
+ rename("/hdd/epg.dat", "/hdd/epg.dat.$$$");
+ FILE *f = fopen("/hdd/epg.dat.$$$", "r");
if (f)
{
int size=0;
@@ -892,12 +893,14 @@ void eEPGCache::load()
{
eDebug("[EPGC] epg file has incorrect byte order.. dont read it");
fclose(f);
+ unlink("/hdd/epg.dat.$$$");
return;
}
char text1[13];
fread( text1, 13, 1, f);
if ( !strncmp( text1, "ENIGMA_EPG_V7", 13) )
{
+ singleLock s(cache_lock);
fread( &size, sizeof(int), 1, f);
while(size--)
{
@@ -969,6 +972,7 @@ void eEPGCache::load()
fclose(f);
}
}
+ unlink("/hdd/epg.dat.$$$");
}
void eEPGCache::save()