mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-09 13:07:58 -05:00
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>
This commit is contained in:
parent
a611879318
commit
c78a808c49
@ -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",
|
_alpm_log(PM_LOG_DEBUG, "partition %s, needed %ld, cushion %ld, free %ld\n",
|
||||||
data->mount_dir, data->max_blocks_needed, cushion,
|
data->mount_dir, data->max_blocks_needed, cushion,
|
||||||
(unsigned long)data->fsp.f_bfree);
|
(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;
|
abort = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user