summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-11-20 16:00:06 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-11-20 16:00:06 +0200
commit5e26a8be7193a90612d800eadba46b417c1d4944 (patch)
treef0b219cd91ee465ad037288607b8809b33a03f4c /lib
parent58bece68422ba6cf20a1fe4ac4816ecd811e384d (diff)
downloadrpm-5e26a8be7193a90612d800eadba46b417c1d4944.tar.gz
rpm-5e26a8be7193a90612d800eadba46b417c1d4944.tar.bz2
rpm-5e26a8be7193a90612d800eadba46b417c1d4944.zip
Error out early trying to install on readonly fs (ticket #99, RhBug:464750)
- simply make readonly filesystems appear as full, preventing install early instead of failing with cpio errors in middle of transaction
Diffstat (limited to 'lib')
-rw-r--r--lib/rpmts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 6e28b8245..1651590f4 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -818,7 +818,7 @@ int rpmtsInitDSI(const rpmts ts)
dsi->bneeded = 0;
dsi->ineeded = 0;
#ifdef STATFS_HAS_F_BAVAIL
- dsi->bavail = sfb.f_bavail;
+ dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail;
#else
/* FIXME: the statfs struct doesn't have a member to tell how many blocks are
* available for non-superusers. f_blocks - f_bfree is probably too big, but