mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
sync_cleandb: ensure stat call succeeds
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
9f1c5f0251
commit
578ceb29fa
@ -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"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user