- 'vmstat -w' was not wide enough (#1025833)

This commit is contained in:
Jaromir Capik 2014-01-20 20:25:49 +01:00
parent e6e93b7625
commit c48f403ec4
2 changed files with 36 additions and 1 deletions

View File

@ -4,13 +4,15 @@
Summary: System and process monitoring utilities
Name: procps-ng
Version: 3.3.9
Release: 2%{?dist}
Release: 3%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
Group: Applications/System
URL: https://sourceforge.net/projects/procps-ng/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
Patch0: vmstat-wide-not-wide-enough.patch
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@ -73,6 +75,8 @@ System and process monitoring utilities development headers
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%build
# The following stuff is needed for git archives only
@ -141,6 +145,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%{_includedir}/proc
%changelog
* Mon Jan 20 2014 Jaromir Capik <jcapik@redhat.com> - 3.3.9-3
- 'vmstat -w' was not wide enough (#1025833)
* Tue Jan 07 2014 Jaromir Capik <jcapik@redhat.com> - 3.3.9-2
- Replacing the /sbin/pidof wrapper with symlink

View File

@ -0,0 +1,28 @@
diff --git a/vmstat.c b/vmstat.c
index 67515c1..c01351d 100644
--- a/vmstat.c
+++ b/vmstat.c
@@ -187,12 +187,12 @@ static void new_header(void)
const char header[] =
"procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----\n";
const char wide_header[] =
- "procs ---------------memory-------------- ---swap-- -----io---- -system-- ------cpu-----\n";
+ "procs -----------------------memory---------------------- ---swap-- -----io---- -system-- --------cpu--------\n";
const char format[] =
"%2s %2s %6s %6s %6s %6s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s\n";
const char wide_format[] =
- "%2s %2s %8s %8s %8s %8s %4s %4s %5s %5s %4s %4s %2s %2s %2s %2s %2s\n";
+ "%2s %2s %12s %12s %12s %12s %4s %4s %5s %5s %4s %4s %3s %3s %3s %3s %3s\n";
printf(w_option ? _(wide_header) : _(header));
printf(
@@ -249,7 +249,7 @@ static void new_format(void)
const char format[] =
"%2u %2u %6lu %6lu %6lu %6lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\n";
const char wide_format[] =
- "%2u %2u %8lu %8lu %8lu %8lu %4u %4u %5u %5u %4u %4u %2u %2u %2u %2u %2u\n";
+ "%2u %2u %12lu %12lu %12lu %12lu %4u %4u %5u %5u %4u %4u %3u %3u %3u %3u %3u\n";
unsigned int tog = 0; /* toggle switch for cleaner code */
unsigned int i;