[procps] Fix for #711192 - "Non-standard uts for running kernel" with linux 3.0

Jaromír Cápík jcapik at fedoraproject.org
Fri Jun 10 15:48:25 UTC 2011


commit ad50c8a9f4ca5f705e4e7a74a4613e1f008f1f18
Author: Jaromir Capik <jcapik at redhat.com>
Date:   Fri Jun 10 17:47:48 2011 +0200

    Fix for #711192 - "Non-standard uts for running kernel" with linux 3.0

 procps-3.2.8-kernel3-uts.patch |   20 ++++++++++++++++++++
 procps.spec                    |    8 +++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/procps-3.2.8-kernel3-uts.patch b/procps-3.2.8-kernel3-uts.patch
new file mode 100644
index 0000000..a72ae59
--- /dev/null
+++ b/procps-3.2.8-kernel3-uts.patch
@@ -0,0 +1,20 @@
+diff -Naur procps-3.2.8-20110302git.orig/proc/version.c procps-3.2.8-20110302git/proc/version.c
+--- procps-3.2.8-20110302git.orig/proc/version.c	2011-06-10 17:00:33.000000000 +0200
++++ procps-3.2.8-20110302git/proc/version.c	2011-06-10 17:20:17.000000000 +0200
+@@ -38,10 +38,15 @@
+ void init_Linux_version(void) {
+     static struct utsname uts;
+     int x = 0, y = 0, z = 0;	/* cleared in case sscanf() < 3 */
++    int version_string_depth;
+     
+     if (uname(&uts) == -1)	/* failure implies impending death */
+ 	exit(1);
+-    if (sscanf(uts.release, "%d.%d.%d", &x, &y, &z) < 3)
++
++    version_string_depth = sscanf(uts.release, "%d.%d.%d", &x, &y, &z);
++	
++    if ((version_string_depth < 2) ||		 /* Non-standard for all known kernels */
++       ((version_string_depth < 3) && (x < 3))) /* Non-standard for 2.x.x kernels */
+ 	fprintf(stderr,		/* *very* unlikely to happen by accident */
+ 		"Non-standard uts for running kernel:\n"
+ 		"release %s=%d.%d.%d gives version code %d\n",
diff --git a/procps.spec b/procps.spec
index caec2c2..1a16dbe 100644
--- a/procps.spec
+++ b/procps.spec
@@ -3,7 +3,7 @@
 Summary: System and process monitoring utilities
 Name: procps
 Version: 3.2.8
-Release: 21.%{gitver}%{?dist}
+Release: 22.%{gitver}%{?dist}
 License: GPLv2+ and LGPLv2+
 Group: Applications/System
 URL: http://gitorious.org/procps
@@ -71,6 +71,8 @@ Patch47: procps-pmap-smaps.patch
 Patch48: procps-3.2.8-w-envlength.patch
 #532668 - procps/top SWAP statistics makes no sense
 Patch49: procps-3.2.8-top-swap.patch
+#711192 - "Non-standard uts for running kernel" with linux 3.0
+Patch50: procps-3.2.8-kernel3-uts.patch
 
 
 BuildRequires: ncurses-devel
@@ -137,6 +139,7 @@ System and process monitoring utilities development headers
 %patch47 -p1
 %patch48 -p1
 %patch49 -p1
+%patch50 -p1
 
 cp %SOURCE1 .
 
@@ -187,6 +190,9 @@ rm -rf %{buildroot}
 /%{_lib}/libproc.so
 
 %changelog
+* Fri Jun 10 2011 Jaromir Capik <jcapik at redhat.com> 3.2.8-22.20110302git
+- Fix for #711192 - "Non-standard uts for running kernel" with linux 3.0
+
 * Thu Jun 02 2011 Jan Görig <jgorig at redhat.com> 3.2.8-21.20110302git
 - added manual page fix to previous patch
 


More information about the scm-commits mailing list