[procinfo] fixed overflow in hms calculations (#676651) - thanks to ychavan at redhat.com

Jan Görig jgorig at fedoraproject.org
Mon Feb 14 09:00:28 UTC 2011


commit 267eef3e674569cf8b446dfea1b3a37bac3dcc22
Author: Jan Görig <jgorig at redhat.com>
Date:   Mon Feb 14 09:55:09 2011 +0100

    fixed overflow in hms calculations (#676651) - thanks to ychavan at redhat.com

 procinfo-18-idle-overflow.patch |   20 ++++++++++++++++++++
 procinfo.spec                   |    7 ++++++-
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/procinfo-18-idle-overflow.patch b/procinfo-18-idle-overflow.patch
new file mode 100644
index 0000000..9242433
--- /dev/null
+++ b/procinfo-18-idle-overflow.patch
@@ -0,0 +1,20 @@
+--- procinfo-18/routines.c.orig	2011-02-11 03:32:17.000000000 +0530
++++ procinfo-18/routines.c	2011-02-11 03:35:01.000000000 +0530
+@@ -392,13 +392,13 @@ 
+ 
+     t *= (100 / HZ);
+     d = (unsigned int) (t / 8640000);
+-    t -= (unsigned long) (d * 8640000);
++    t -= ((unsigned long) d * 8640000);
+     h = (unsigned int) (t / 360000);
+-    t -= (unsigned long) (h * 360000);
++    t -= ((unsigned long) h * 360000);
+     m = (unsigned int) (t / 6000);
+-    t -= (unsigned long) (m * 6000);
++    t -= ((unsigned long) m * 6000);
+     s = (unsigned int) (t / 100);
+-    t -= (unsigned long) (s * 100);
++    t -= ((unsigned long) s * 100);
+     if (d > 0)
+ 	sprintf (buf, "%3ud %2u:%02u:%02u.%02u", d, h, m, s, (unsigned int) t);
+     else
diff --git a/procinfo.spec b/procinfo.spec
index b72e839..3eea827 100644
--- a/procinfo.spec
+++ b/procinfo.spec
@@ -1,7 +1,7 @@
 Summary: A tool for gathering and displaying system information
 Name: procinfo
 Version: 18
-Release: 28%{dist}
+Release: 29%{dist}
 License: GPL+
 Group: Applications/System
 Source: ftp://ftp.cistron.nl/pub/people/00-OLD/svm/%{name}-%{version}.tar.gz
@@ -19,6 +19,7 @@ Patch13: procinfo-18-intrprint.patch
 Patch14: procinfo-18-version.patch
 Patch15: procinfo-18-man-comment.patch
 Patch16: procinfo-18-socklist.patch
+Patch17: procinfo-18-idle-overflow.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: ncurses-devel
@@ -48,6 +49,7 @@ data.
 %patch14 -p1 -b .version
 %patch15 -p1 -b .mancomment
 %patch16 -p0 -b .socklist
+%patch17 -p1 -b .idle
 
 %build
 make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -I/usr/include/ncurses" LDFLAGS= LDLIBS=-lncurses
@@ -72,6 +74,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/socklist.8*
 
 %changelog
+* Mon Feb 14 2011 Jan Görig <jgorig at redhat.com> 18-29
+- fixed overflow in hms calculations (#676651) - thanks to ychavan at redhat.com
+
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 18-28
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 


More information about the scm-commits mailing list