diff --git a/opentrafficshaper/plugins/configmanager.pm b/opentrafficshaper/plugins/configmanager.pm index 0c54759a6526195a0b8758878a4cec3695b67952..c4f7da29a5449e224d478539469578f1785cd930 100644 --- a/opentrafficshaper/plugins/configmanager.pm +++ b/opentrafficshaper/plugins/configmanager.pm @@ -3037,14 +3037,15 @@ sub _override_remove_pool # Load our statefile sub _load_statefile { - my $kernel = shift; - - # Check if the state file exists first of all - if (! -e $config->{'statefile'}) { + if (! -f $config->{'statefile'}) { $logger->log(LOG_ERR,"[CONFIGMANAGER] Statefile '%s' doesn't exist",$config->{'statefile'}); return; } + if (! -s $config->{'statefile'}) { + $logger->log(LOG_ERR,"[CONFIGMANAGER] Statefile '%s' has zero size ignoring",$config->{'statefile'}); + return; + } $logger->log(LOG_NOTICE,"[CONFIGMANAGER] Loading statefile '%s'",$config->{'statefile'});