core/procps/procps-3.2.8-kernel3-uts.patch
2011-08-08 12:54:54 +00:00

21 lines
986 B
Diff

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",