[libgtop2/f17] Fix fetching rootfs stats (bz #871628)
Cole Robinson
crobinso at fedoraproject.org
Tue Feb 12 22:36:43 UTC 2013
commit 797fff06eecdc7a6cb3ef222a71c71049f739509
Author: Cole Robinson <crobinso at redhat.com>
Date: Tue Feb 12 17:36:40 2013 -0500
Fix fetching rootfs stats (bz #871628)
...ge-Fix-fetching-rootfs-stats-on-Fedora-17.patch | 34 ++++++++++++++++++++
libgtop2.spec | 8 ++++-
2 files changed, 41 insertions(+), 1 deletions(-)
---
diff --git a/0001-fsusage-Fix-fetching-rootfs-stats-on-Fedora-17.patch b/0001-fsusage-Fix-fetching-rootfs-stats-on-Fedora-17.patch
new file mode 100644
index 0000000..c235f51
--- /dev/null
+++ b/0001-fsusage-Fix-fetching-rootfs-stats-on-Fedora-17.patch
@@ -0,0 +1,34 @@
+From 37774dc02db47f815d3a3da4e51d91c6d3f4bb16 Mon Sep 17 00:00:00 2001
+Message-Id: <37774dc02db47f815d3a3da4e51d91c6d3f4bb16.1360687625.git.crobinso at redhat.com>
+From: Cole Robinson <crobinso at redhat.com>
+Date: Mon, 28 Jan 2013 23:02:04 +0100
+Subject: [PATCH] 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
+---
+ sysdeps/linux/fsusage.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/sysdeps/linux/fsusage.c b/sysdeps/linux/fsusage.c
+index 1356494..b186767 100644
+--- a/sysdeps/linux/fsusage.c
++++ b/sysdeps/linux/fsusage.c
+@@ -41,6 +41,10 @@ get_device(glibtop* server, const char *mountpoint,
+
+ 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 (!strncmp(mnt->mnt_fsname, "/dev/", 5)) {
+ g_strlcpy(device, mnt->mnt_fsname + 5, device_size);
+--
+1.8.1
+
diff --git a/libgtop2.spec b/libgtop2.spec
index 70fa79e..14f088f 100644
--- a/libgtop2.spec
+++ b/libgtop2.spec
@@ -3,12 +3,14 @@
Name: libgtop2
Summary: LibGTop library (version 2)
Version: 2.28.4
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2+
URL: http://download.gnome.org/sources/libgtop/2.28
Group: System Environment/Libraries
#VCS: git://git.gnome.org/libgtop
Source: http://download.gnome.org/sources/libgtop/2.28/libgtop-%{version}.tar.xz
+# Fix fetching rootfs stats (bz 871628)
+Patch1: 0001-fsusage-Fix-fetching-rootfs-stats-on-Fedora-17.patch
BuildRequires: glib2-devel
BuildRequires: gobject-introspection-devel
BuildRequires: libtool gettext
@@ -29,6 +31,7 @@ files to allow you to develop with LibGTop.
%prep
%setup -q -n libgtop-%{version}
+%patch1 -p1
%build
%configure --disable-gtk-doc --disable-static
@@ -64,6 +67,9 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
%exclude %{_datadir}/info
%changelog
+* Tue Feb 12 2013 Cole Robinson <crobinso at redhat.com> - 2.28.4-3
+- Fix fetching rootfs stats (bz #871628)
+
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.28.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
More information about the scm-commits
mailing list