fsusage: Fix fetching rootfs stats on Fedora 17
When fsusage scans mtab, it matches on the first entry, but since 'rootfs' isn't of the expected format '/dev/<blah>' it bails out. Match early on any rootfs entries and skip them. Fixes #685897
This commit is contained in:
committed by
Jasper Lievisse Adriaanse
parent
4efe3721e7
commit
37774dc02d
@@ -41,6 +41,10 @@ get_device(glibtop* server, const char *mountpoint,
|
|||||||
|
|
||||||
while ((mnt = getmntent(fp)))
|
while ((mnt = getmntent(fp)))
|
||||||
{
|
{
|
||||||
|
/* There can be multiple root mount entries, skip the unuseful one */
|
||||||
|
if (!strcmp(mnt->mnt_fsname, "rootfs"))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!strcmp(mountpoint, mnt->mnt_dir)) {
|
if (!strcmp(mountpoint, mnt->mnt_dir)) {
|
||||||
if (!strncmp(mnt->mnt_fsname, "/dev/", 5)) {
|
if (!strncmp(mnt->mnt_fsname, "/dev/", 5)) {
|
||||||
g_strlcpy(device, mnt->mnt_fsname + 5, device_size);
|
g_strlcpy(device, mnt->mnt_fsname + 5, device_size);
|
||||||
|
Reference in New Issue
Block a user