Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-02-25 01:05:20 +1000
committerAllan McRae <allan@archlinux.org>2015-03-03 16:54:17 +1000
commit578ceb29faa2673b7b0e4f4cc311ba77d6acb4b4 (patch)
tree2b1aa758cac73c1473a670caa15c1ee75491fa32
parent9f1c5f0251c202ad504f03464da23a5050914157 (diff)
sync_cleandb: ensure stat call succeeds
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--src/pacman/sync.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 91eca7e4..0c3151e1 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -94,7 +94,10 @@ static int sync_cleandb(const char *dbpath, int keep_used)
snprintf(path, PATH_MAX, "%s%s", dbpath, dname);
/* remove all non-skipped directories and non-database files */
- stat(path, &buf);
+ if(stat(path, &buf) == -1) {
+ pm_printf(ALPM_LOG_ERROR, _("could not remove %s: %s\n"),
+ path, strerror(errno));
+ }
if(S_ISDIR(buf.st_mode)) {
if(rmrf(path)) {
pm_printf(ALPM_LOG_ERROR, _("could not remove %s: %s\n"),