summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2003-01-25 18:10:30 +0000
committerjbj <devnull@localhost>2003-01-25 18:10:30 +0000
commit8441baccd286b9693e74841946d338c3667f0bae (patch)
treebf4d7703db98ec2937e0c7cf5325128e1e54e7f3 /lib
parent79365b0a0d558e40aea22d5c87a25b372f69accc (diff)
downloadrpm-8441baccd286b9693e74841946d338c3667f0bae.tar.gz
rpm-8441baccd286b9693e74841946d338c3667f0bae.tar.bz2
rpm-8441baccd286b9693e74841946d338c3667f0bae.zip
Display statfs(2) returns for debugging.
CVS patchset: 6027 CVS date: 2003/01/25 18:10:30
Diffstat (limited to 'lib')
-rw-r--r--lib/fs.c17
-rw-r--r--lib/rpmts.c10
2 files changed, 20 insertions, 7 deletions
diff --git a/lib/fs.c b/lib/fs.c
index 73ee6d6fa..cf473e037 100644
--- a/lib/fs.c
+++ b/lib/fs.c
@@ -200,16 +200,23 @@ static int getFilesystemList(void)
return 1;
}
- numFilesystems++;
- if ((numFilesystems + 1) == numAlloced) {
+ if ((numFilesystems + 2) == numAlloced) {
numAlloced += 10;
filesystems = xrealloc(filesystems,
sizeof(*filesystems) * (numAlloced + 1));
}
- filesystems[numFilesystems-1].dev = sb.st_dev;
- filesystems[numFilesystems-1].mntPoint = xstrdup(mntdir);
- filesystems[numFilesystems-1].rdonly = rdonly;
+ filesystems[numFilesystems].dev = sb.st_dev;
+ filesystems[numFilesystems].mntPoint = xstrdup(mntdir);
+ filesystems[numFilesystems].rdonly = rdonly;
+#if 0
+ rpmMessage(RPMMESS_DEBUG, _("%5d 0x%04x %s %s\n"),
+ numFilesystems,
+ (unsigned) filesystems[numFilesystems].dev,
+ (filesystems[numFilesystems].rdonly ? "ro" : "rw"),
+ filesystems[numFilesystems].mntPoint);
+#endif
+ numFilesystems++;
}
# if GETMNTENT_ONE || GETMNTENT_TWO
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 0ea182914..b39e0e400 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -920,14 +920,16 @@ int rpmtsInitDSI(const rpmts ts)
if (rpmtsFilterFlags(ts) & RPMPROB_FILTER_DISKSPACE)
return 0;
+ rpmMessage(RPMMESS_DEBUG, _("mounted filesystems:\n"));
+ rpmMessage(RPMMESS_DEBUG,
+ _(" i dev bsize bavail iavail mount point\n"));
+
rc = rpmGetFilesystemList(&ts->filesystems, &ts->filesystemCount);
if (rc || ts->filesystems == NULL || ts->filesystemCount <= 0)
return rc;
/* Get available space on mounted file systems. */
- rpmMessage(RPMMESS_DEBUG, _("getting list of mounted filesystems\n"));
-
ts->dsi = _free(ts->dsi);
ts->dsi = xcalloc((ts->filesystemCount + 1), sizeof(*ts->dsi));
@@ -976,6 +978,10 @@ int rpmtsInitDSI(const rpmts ts)
/* XXX Avoid FAT and other file systems that have not inodes. */
dsi->iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0)
? sfb.f_ffree : -1;
+ rpmMessage(RPMMESS_DEBUG, _("%5d 0x%04x %5u %12ld %12ld %s\n"),
+ i, (unsigned) dsi->dev, (unsigned) dsi->bsize,
+ (signed long) dsi->bavail, (signed long) dsi->iavail,
+ ts->filesystems[i]);
}
return rc;
}