Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=24e18c44dda28f67df841012c798caf1666ebd8b

commit 24e18c44dda28f67df841012c798caf1666ebd8b
Author: Michel Hermier <herm...@frugalware.org>
Date:   Thu Nov 25 13:02:25 2010 +0100

lib/libpacman/util.c: _pacman_check_freespace handle get_freespace return code.

* The free space checking may return negative value on getmntent failure
(like /etc/mtab does not exist yet).

diff --git a/lib/libpacman/util.c b/lib/libpacman/util.c
index afdc6a4..0928974 100644
--- a/lib/libpacman/util.c
+++ b/lib/libpacman/util.c
@@ -760,6 +760,10 @@ int _pacman_check_freespace(pmtrans_t *trans, pmlist_t 
**data)
}
}
freespace = get_freespace();
+       if(freespace < 0) {
+               _pacman_log(PM_LOG_WARNING, _("check_freespace: total pkg size: 
%lld, disk space: unknown"), pkgsize);
+               return(0);
+       }
_pacman_log(PM_LOG_DEBUG, _("check_freespace: total pkg size: %lld, disk space: 
%lld"), pkgsize, freespace);
if(pkgsize > freespace) {
if(data) {
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to