apply BusyBox 1.20.2 hotfixes
authorDennis Groenen <tj.groenen@gmail.com>
Wed, 22 Aug 2012 10:57:06 +0000 (12:57 +0200)
committerDennis Groenen <tj.groenen@gmail.com>
Wed, 22 Aug 2012 10:57:06 +0000 (12:57 +0200)
debian/patches/hotfixes/busybox-1.20.2-kernel_ver.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/hotfixes/busybox-1.20.2-kernel_ver.patch b/debian/patches/hotfixes/busybox-1.20.2-kernel_ver.patch
new file mode 100644 (file)
index 0000000..456fb08
--- /dev/null
@@ -0,0 +1,25 @@
+--- busybox-1.20.2/libbb/kernel_version.c
++++ busybox-1.20.2-kernel_ver/libbb/kernel_version.c
+@@ -20,18 +20,15 @@
+ int FAST_FUNC get_linux_version_code(void)
+ {
+       struct utsname name;
+-      char *s;
++      char *s, *t;
+       int i, r;
+-      if (uname(&name) == -1) {
+-              bb_perror_msg("can't get system information");
+-              return 0;
+-      }
+-
++      uname(&name); /* never fails */
+       s = name.release;
+       r = 0;
+       for (i = 0; i < 3; i++) {
+-              r = r * 256 + atoi(strtok(s, "."));
++              t = strtok(s, ".");
++              r = r * 256 + (t ? atoi(t) : 0);
+               s = NULL;
+       }
+       return r;
index 00a9e92..e1fb88d 100644 (file)
@@ -19,6 +19,7 @@ ps-accept-and-ignore-missing-options.patch
 showkey-default-option.patch
 
 # Hotfixes
+hotfixes/busybox-1.20.2-kernel_ver.patch
 
 # Dark blue on black is nearly impossible to read, use red.
 # Leaving this commented out as dark blue on white is fine, and there isn't any