Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F136836112
D15952.id44274.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D15952.id44274.diff
View Options
Index: head/sys/amd64/linux/linux_sysvec.c
===================================================================
--- head/sys/amd64/linux/linux_sysvec.c
+++ head/sys/amd64/linux/linux_sysvec.c
@@ -799,10 +799,11 @@
return (false);
/*
- * For Linux we encode osrel as follows (see linux_mib.c):
- * VVVMMMIII (version, major, minor), see linux_mib.c.
+ * For Linux we encode osrel using the Linux convention of
+ * (version << 16) | (major << 8) | (minor)
+ * See macro in linux_mib.h
*/
- *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3];
+ *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]);
return (true);
}
Index: head/sys/amd64/linux32/linux32_sysvec.c
===================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c
+++ head/sys/amd64/linux32/linux32_sysvec.c
@@ -993,10 +993,11 @@
return (false);
/*
- * For Linux we encode osrel as follows (see linux_mib.c):
- * VVVMMMIII (version, major, minor), see linux_mib.c.
+ * For Linux we encode osrel using the Linux convention of
+ * (version << 16) | (major << 8) | (minor)
+ * See macro in linux_mib.h
*/
- *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3];
+ *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]);
return (true);
}
Index: head/sys/compat/linux/linux_mib.c
===================================================================
--- head/sys/compat/linux/linux_mib.c
+++ head/sys/compat/linux/linux_mib.c
@@ -149,8 +149,8 @@
if (osrelease == sep || sep != eosrelease)
return (EINVAL);
- v = v0 * 1000000 + v1 * 1000 + v2;
- if (v < 1000000)
+ v = LINUX_KERNVER(v0, v1, v2);
+ if (v < LINUX_KERNVER(1, 0, 0))
return (EINVAL);
if (osrel != NULL)
Index: head/sys/i386/linux/linux_sysvec.c
===================================================================
--- head/sys/i386/linux/linux_sysvec.c
+++ head/sys/i386/linux/linux_sysvec.c
@@ -970,10 +970,11 @@
return (false);
/*
- * For Linux we encode osrel as follows (see linux_mib.c):
- * VVVMMMIII (version, major, minor), see linux_mib.c.
+ * For Linux we encode osrel using the Linux convention of
+ * (version << 16) | (major << 8) | (minor)
+ * See macro in linux_mib.h
*/
- *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3];
+ *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]);
return (true);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 20, 11:06 PM (13 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25741439
Default Alt Text
D15952.id44274.diff (2 KB)
Attached To
Mode
D15952: Fix the Linux kernel version number calculation
Attached
Detach File
Event Timeline
Log In to Comment