summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2015-02-24 16:10:35 +0100
committerAllan McRae <allan@archlinux.org>2015-03-03 07:54:17 +0100
commit8f92fe47a7c4d999271bc28ffbbeeea50d686813 (patch)
tree765d79c5f44bb226ec49286879ce786f97cc93f4 /lib/libalpm
parent578ceb29faa2673b7b0e4f4cc311ba77d6acb4b4 (diff)
downloadpacman-8f92fe47a7c4d999271bc28ffbbeeea50d686813.tar.gz
pacman-8f92fe47a7c4d999271bc28ffbbeeea50d686813.tar.xz
calculate_removed_size: ensure llstat succeeds
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/diskspace.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index 3b496c2e..aaa00365 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -235,7 +235,12 @@ static int calculate_removed_size(alpm_handle_t *handle,
const char *filename = file->name;
snprintf(path, PATH_MAX, "%s%s", handle->root, filename);
- llstat(path, &st);
+
+ if(llstat(path, &st) == -1) {
+ _alpm_log(handle, ALPM_LOG_WARNING,
+ _("could not get file information for %s\n"), filename);
+ continue;
+ }
/* skip directories and symlinks to be consistent with libarchive that
* reports them to be zero size */