[pacman-dev] [PATCH 1/3] Add missing closedir calls in cache cleanup

Dan McGee dan at archlinux.org
Mon Sep 21 09:15:35 EDT 2009


Signed-off-by: Dan McGee <dan at archlinux.org>
---
 src/pacman/sync.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index aa09117..837c2b3 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -93,11 +93,12 @@ static int sync_cleandb(const char *dbpath, int keep_used) {
 			if(rmrf(path)) {
 				pm_fprintf(stderr, PM_LOG_ERROR,
 					_("could not remove repository directory\n"));
+				closedir(dir);
 				return(1);
 			}
 		}
-
 	}
+	closedir(dir);
 	return(0);
 }
 
@@ -215,6 +216,7 @@ static int sync_cleancache(int level)
 				unlink(path);
 			}
 		}
+		closedir(dir);
 	} else {
 		/* full cleanup */
 		printf(_("Cache directory: %s\n"), cachedir);
-- 
1.6.4.4



More information about the pacman-dev mailing list