xml epg: del file even if parsing fails

This commit is contained in:
TangoCash
2022-09-09 22:43:15 +02:00
committed by Thilo Graf
parent 9a4bd22793
commit 7fd4dd9f69

View File

@@ -462,6 +462,12 @@ bool readEventsFromXMLTV(std::string &epgname, int &ev_count, bool delete_after)
if (!(event_parser = parseXmlFile(epgname.c_str())))
{
debug(DEBUG_NORMAL, "unable to open %s for reading", epgname.c_str());
if (delete_after)
{
int ret = unlink(epgname.c_str());
if (ret != 0)
printf("Failed to delete file: %s\n", epgname.c_str());
}
return false;
}