diff options
Diffstat (limited to 'core/procps-ng/gnu-kbsd-version.patch')
-rw-r--r-- | core/procps-ng/gnu-kbsd-version.patch | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/core/procps-ng/gnu-kbsd-version.patch b/core/procps-ng/gnu-kbsd-version.patch deleted file mode 100644 index f310a4c93..000000000 --- a/core/procps-ng/gnu-kbsd-version.patch +++ /dev/null @@ -1,38 +0,0 @@ -Author: <csmall@debian.org> -Description: Rework version parsing so its ok with other OSes ---- a/proc/version.c -+++ b/proc/version.c -@@ -28,20 +28,26 @@ - int linux_version_code; - - void init_Linux_version(void) { -- static struct utsname uts; - int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */ -+ FILE *fp; -+ char buf[256]; - int version_string_depth; - -- if (uname(&uts) == -1) /* failure implies impending death */ -- exit(1); -- -- version_string_depth = sscanf(uts.release, "%d.%d.%d", &x, &y, &z); -+ if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */ -+ exit(1); -+ if (fgets(buf, 256, fp) == NULL) { -+ fprintf(stderr, "Cannot read kernel version from /proc/version\n"); -+ fclose(fp); -+ exit(1); -+ } -+ fclose(fp); -+ version_string_depth = sscanf(buf, "Linux version %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", -- uts.release, x, y, z, LINUX_VERSION(x,y,z)); -+ "%s=%d.%d.%d gives version code %d\n", -+ buf, x, y, z, LINUX_VERSION(x,y,z)); - linux_version_code = LINUX_VERSION(x, y, z); - } |