Do not delete the monitor directory in event path, this introduces so much troubles...

This commit is contained in:
Emmanuel Papin 2015-01-27 21:11:00 +01:00
parent 7c0dfe9a5b
commit bfef99fc6f
1 changed files with 4 additions and 4 deletions

View File

@ -261,9 +261,9 @@ void Event::DeleteEvent()
static char dir_events[PATH_MAX] = ""; static char dir_events[PATH_MAX] = "";
if ( config.dir_events[0] == '/' ) if ( config.dir_events[0] == '/' )
snprintf( dir_events, sizeof(dir_events), "%s", config.dir_events ); snprintf( dir_events, sizeof(dir_events), "%s/%d", config.dir_events, monitor->Id() );
else else
snprintf( dir_events, sizeof(dir_events), "%s/%s", staticConfig.PATH_WEB.c_str(), config.dir_events ); snprintf( dir_events, sizeof(dir_events), "%s/%s/%d", staticConfig.PATH_WEB.c_str(), config.dir_events, monitor->Id() );
if ( config.use_deep_storage ) if ( config.use_deep_storage )
{ {
@ -297,8 +297,8 @@ void Event::DeleteEvent()
if (unlink(event_path) < 0) if (unlink(event_path) < 0)
return; return;
// Now we have successfully deleted all files we can do some // Now we have successfully deleted all files related to the
// cleaning on the storage directory // event we can do some cleaning on the storage directory
// The storage folders are scanned from deep to root and // The storage folders are scanned from deep to root and
// deleted if empty // deleted if empty
for(size_t i=strlen(link_path)-1; i>strlen(dir_events); i--) for(size_t i=strlen(link_path)-1; i>strlen(dir_events); i--)