- Skipping trailing zeros in read_unvectored (#1057600)

This commit is contained in:
Jaromir Capik 2014-01-24 18:39:00 +01:00
parent c48f403ec4
commit 4dc8543b0e
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,11 @@
diff -Naur procps-ng-3.3.9.orig/proc/readproc.c procps-ng-3.3.9/proc/readproc.c
--- procps-ng-3.3.9.orig/proc/readproc.c 2013-11-25 10:57:32.000000000 +0100
+++ procps-ng-3.3.9/proc/readproc.c 2014-01-24 16:20:02.222000000 +0100
@@ -686,6 +686,7 @@
close(fd);
if(n){
int i=n;
+ while(i && dst[i-1]=='\0') --i; // skip trailing zeros
while(i--)
if(dst[i]=='\n' || dst[i]=='\0') dst[i]=sep;
if(dst[n-1]==' ') dst[n-1]='\0';

View File

@ -4,7 +4,7 @@
Summary: System and process monitoring utilities
Name: procps-ng
Version: 3.3.9
Release: 3%{?dist}
Release: 4%{?dist}
License: GPL+ and GPLv2 and GPLv2+ and GPLv3+ and LGPLv2+
Group: Applications/System
URL: https://sourceforge.net/projects/procps-ng/
@ -12,6 +12,7 @@ URL: https://sourceforge.net/projects/procps-ng/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
Patch0: vmstat-wide-not-wide-enough.patch
Patch1: ksh-skip-trailing-zeros.patch
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
@ -76,6 +77,7 @@ System and process monitoring utilities development headers
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%build
@ -145,6 +147,9 @@ ln -s %{_bindir}/pidof %{buildroot}%{_sbindir}/pidof
%{_includedir}/proc
%changelog
* Fri Jan 24 2014 Jaromir Capik <jcapik@redhat.com> - 3.3.9-4
- Skipping trailing zeros in read_unvectored (#1057600)
* Mon Jan 20 2014 Jaromir Capik <jcapik@redhat.com> - 3.3.9-3
- 'vmstat -w' was not wide enough (#1025833)