From 16efe7ca33499e0aeab20d3b648d35f89b8996fe Mon Sep 17 00:00:00 2001 From: darode Date: Fri, 16 Jul 2010 12:10:49 +0000 Subject: [PATCH] 2010-07-16 Dario Rodriguez * misc/pandora_file.cc: fixed unclosed directory with function closedir. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3017 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/win32/ChangeLog | 4 ++++ pandora_agents/win32/misc/pandora_file.cc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 72808b1537..865bb5b3e4 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,7 @@ +2010-07-16 Dario Rodriguez + + * misc/pandora_file.cc: fixed unclosed directory with function closedir. + 2010-07-16 Dario Rodriguez * misc/pandora_file.cc, pandora_file.h: Added function to remove directories diff --git a/pandora_agents/win32/misc/pandora_file.cc b/pandora_agents/win32/misc/pandora_file.cc index 9407ab7f1c..b8f673da1f 100644 --- a/pandora_agents/win32/misc/pandora_file.cc +++ b/pandora_agents/win32/misc/pandora_file.cc @@ -154,7 +154,7 @@ Pandora_File::removeDir (const string filepath) { /*Open the directory*/ dir = opendir (filepath.c_str ()); - + /*If not open*/ if (dir == NULL) { /**If not exists*/ @@ -207,6 +207,9 @@ Pandora_File::removeDir (const string filepath) { if (rmdir (filepath.c_str ()) == -1) { return DELETE_ERROR; } + + /*Close dir oppened*/ + closedir(dir); return 0; }