mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 01:11:12 +02:00
neutrino.cpp: comment saveSetup in signal handler - this can damage config file,
try to protect against broken config - check screen_End* and load load defaults
This commit is contained in:
@@ -287,6 +287,15 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
if(!configfile.loadConfig(fname)) {
|
if(!configfile.loadConfig(fname)) {
|
||||||
//file existiert nicht
|
//file existiert nicht
|
||||||
erg = 1;
|
erg = 1;
|
||||||
|
} else {
|
||||||
|
/* try to detect bad / broken config file */
|
||||||
|
if (!configfile.getInt32("screen_EndX_crt", 0) ||
|
||||||
|
!configfile.getInt32("screen_EndY_crt", 0) ||
|
||||||
|
!configfile.getInt32("screen_EndX_lcd", 0) ||
|
||||||
|
!configfile.getInt32("screen_EndY_lcd", 0)) {
|
||||||
|
printf("[neutrino] config file %s is broken, using defaults\n", fname);
|
||||||
|
configfile.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE);
|
std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE);
|
||||||
if(checkParentallocked) {
|
if(checkParentallocked) {
|
||||||
@@ -3518,7 +3527,7 @@ void sighandler (int signum)
|
|||||||
case SIGTERM:
|
case SIGTERM:
|
||||||
case SIGINT:
|
case SIGINT:
|
||||||
delete CRecordManager::getInstance();
|
delete CRecordManager::getInstance();
|
||||||
CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE);
|
//CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE);
|
||||||
stop_daemons();
|
stop_daemons();
|
||||||
stop_video();
|
stop_video();
|
||||||
//_exit(0);
|
//_exit(0);
|
||||||
|
Reference in New Issue
Block a user