diff options
author | Allan McRae <allan@archlinux.org> | 2015-02-24 16:05:20 +0100 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2015-03-03 07:54:17 +0100 |
commit | 578ceb29faa2673b7b0e4f4cc311ba77d6acb4b4 (patch) | |
tree | 2b1aa758cac73c1473a670caa15c1ee75491fa32 /src | |
parent | 9f1c5f0251c202ad504f03464da23a5050914157 (diff) | |
download | pacman-578ceb29faa2673b7b0e4f4cc311ba77d6acb4b4.tar.gz pacman-578ceb29faa2673b7b0e4f4cc311ba77d6acb4b4.tar.xz |
sync_cleandb: ensure stat call succeeds
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/pacman/sync.c | 5 |
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"), |