summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2010-12-18 13:47:16 +0100
committerDan McGee <dan@archlinux.org>2010-12-21 01:03:34 +0100
commitc78a808c49f1df12254ff9ae5ce32bd450e14df8 (patch)
tree64bf8a315c2d90919b066fd96ec3ba8ebe8b3930 /lib
parenta611879318a4c39488f977308af8ee90f428995b (diff)
downloadpacman-c78a808c49f1df12254ff9ae5ce32bd450e14df8.tar.gz
pacman-c78a808c49f1df12254ff9ae5ce32bd450e14df8.tar.xz
Only check diskspace availability if needs more than zero
The amount of diskspace needed for a transaction can be less than zero. Only test this against the available disk space if it is positive, which avoids a comparison being made between signed and unsigned types (-Wsign-compare). Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/diskspace.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index 97f28ab2..4ac0e496 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -302,7 +302,8 @@ int _alpm_check_diskspace(pmtrans_t *trans, pmdb_t *db_local)
_alpm_log(PM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n",
data->mount_dir, data->max_blocks_needed, cushion,
(unsigned long)data->fsp.f_bfree);
- if(data->max_blocks_needed + cushion > data->fsp.f_bfree) {
+ if(data->max_blocks_needed + cushion >= 0 &&
+ (unsigned long)(data->max_blocks_needed + cushion) > data->fsp.f_bfree) {
abort = 1;
}
}