Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 254689 Details for
Bug 303120
sys-process/procps: fix "Unknown HZ value!" on some machines
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
above patch can't be applied without this one
gnu-kbsd-version.patch (text/plain), 1.38 KB, created by
Chris Coleman
on 2010-11-17 20:46:22 UTC
(
hide
)
Description:
above patch can't be applied without this one
Filename:
MIME Type:
Creator:
Chris Coleman
Created:
2010-11-17 20:46:22 UTC
Size:
1.38 KB
patch
obsolete
>Author: <csmall@debian.org> >Description: Rework version parsing so its ok with other OSes >Index: b/proc/version.c >=================================================================== >--- a/proc/version.c 2009-11-24 20:53:02.000000000 +1100 >+++ b/proc/version.c 2009-11-24 21:00:44.000000000 +1100 >@@ -35,15 +35,23 @@ > > static void init_Linux_version(void) __attribute__((constructor)); > static 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]; > >- if (uname(&uts) == -1) /* failure implies impending death */ >- exit(1); >- if (sscanf(uts.release, "%d.%d.%d", &x, &y, &z) < 3) >+ 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); >+ if (sscanf(buf, "Linux version %d.%d.%d", &x, &y, &z) < 3) > 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)); >+ "release %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); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 303120
:
218096
|
218098
|
252457
|
254257
|
254687
| 254689 |
261747