summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox-1.20.2/busybox-1.20.2-kernel_ver.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/busybox/busybox-1.20.2/busybox-1.20.2-kernel_ver.patch')
-rw-r--r--meta/recipes-core/busybox/busybox-1.20.2/busybox-1.20.2-kernel_ver.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox-1.20.2/busybox-1.20.2-kernel_ver.patch b/meta/recipes-core/busybox/busybox-1.20.2/busybox-1.20.2-kernel_ver.patch
new file mode 100644
index 0000000000..456fb08e11
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox-1.20.2/busybox-1.20.2-kernel_ver.patch
@@ -0,0 +1,25 @@
1--- busybox-1.20.2/libbb/kernel_version.c
2+++ busybox-1.20.2-kernel_ver/libbb/kernel_version.c
3@@ -20,18 +20,15 @@
4 int FAST_FUNC get_linux_version_code(void)
5 {
6 struct utsname name;
7- char *s;
8+ char *s, *t;
9 int i, r;
10
11- if (uname(&name) == -1) {
12- bb_perror_msg("can't get system information");
13- return 0;
14- }
15-
16+ uname(&name); /* never fails */
17 s = name.release;
18 r = 0;
19 for (i = 0; i < 3; i++) {
20- r = r * 256 + atoi(strtok(s, "."));
21+ t = strtok(s, ".");
22+ r = r * 256 + (t ? atoi(t) : 0);
23 s = NULL;
24 }
25 return r;