diff options
-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; } |