xbps-install: abort transaction if there's insufficient disk space on rootdir.

The free disk space wasn't computed correctly and xbps-install(8) wasn't
handling ENOSPC rval in xbps_transaction_prepare().
This commit is contained in:
Juan RP
2014-09-18 12:11:02 +02:00
parent 20326738ed
commit f52eea34d4
3 changed files with 7 additions and 1 deletions

View File

@@ -173,7 +173,7 @@ compute_transaction_stats(struct xbps_handle *xhp)
return 0;
}
/* compute free space on disk */
rootdir_free_size = svfs.f_bavail * svfs.f_bsize - instsize;
rootdir_free_size = svfs.f_bfree * svfs.f_bsize;
if (!xbps_dictionary_set_uint64(xhp->transd,
"disk-free-size", rootdir_free_size))