diff options
author | jbj <devnull@localhost> | 2003-01-25 18:10:30 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2003-01-25 18:10:30 +0000 |
commit | 8441baccd286b9693e74841946d338c3667f0bae (patch) | |
tree | bf4d7703db98ec2937e0c7cf5325128e1e54e7f3 /lib | |
parent | 79365b0a0d558e40aea22d5c87a25b372f69accc (diff) | |
download | rpm-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.c | 17 | ||||
-rw-r--r-- | lib/rpmts.c | 10 |
2 files changed, 20 insertions, 7 deletions
@@ -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; } |