summaryrefslogtreecommitdiff
path: root/recipes/kexec/files/kexec-tools-2-klibc.patch
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2009-10-06 01:13:43 +0200
committerAndrea Adami <andrea.adami@gmail.com>2009-10-06 01:16:09 +0200
commitc518a888a6e5a8180a6e5dddfc7e686d2707a365 (patch)
treeb535b41b506357db0fa37d94df2d24aa3f2cb643 /recipes/kexec/files/kexec-tools-2-klibc.patch
parentd9ec7f1a8d1920dca358dc1f4396d64f055b4275 (diff)
kexec-tools-klibc-static_2.0.1: revised patchset/Tested on arm. Bump PR.
Diffstat (limited to 'recipes/kexec/files/kexec-tools-2-klibc.patch')
-rw-r--r--recipes/kexec/files/kexec-tools-2-klibc.patch17
1 files changed, 14 insertions, 3 deletions
diff --git a/recipes/kexec/files/kexec-tools-2-klibc.patch b/recipes/kexec/files/kexec-tools-2-klibc.patch
index 43b2ebc173..2196249a97 100644
--- a/recipes/kexec/files/kexec-tools-2-klibc.patch
+++ b/recipes/kexec/files/kexec-tools-2-klibc.patch
@@ -143,7 +143,7 @@ Index: kexec-tools-2.0.1/purgatory/string.c
Index: kexec-tools-2.0.1/kexec/kexec.c
===================================================================
--- kexec-tools-2.0.1.orig/kexec/kexec.c 2008-02-24 14:15:46.950825917 +0100
-+++ kexec-tools-2.0.1/kexec/kexec.c 2009-10-05 23:19:39.000000000 +0200
++++ kexec-tools-2.0.1/kexec/kexec.c 2009-10-06 00:37:01.000000000 +0200
@@ -38,9 +38,9 @@
#include "config.h"
@@ -171,7 +171,7 @@ Index: kexec-tools-2.0.1/kexec/kexec.c
int ret;
FILE *fp;
+ char *endptr;
-+ char *line = NULL;
++ char *line[3];
fp = fopen("/sys/kernel/kexec_loaded", "r");
if (fp == NULL)
@@ -187,7 +187,13 @@ Index: kexec-tools-2.0.1/kexec/kexec.c
fclose(fp);
return ret;
}
-@@ -994,9 +1002,14 @@
+@@ -990,17 +998,23 @@
+ {
+ FILE *fp;
+ size_t len;
+- char *line = NULL;
++ const int sizeof_line = 1024;
++ char *line = malloc(sizeof_line); /* according to strdup() later */
fp = fopen("/proc/cmdline", "r");
if (!fp)
@@ -204,6 +210,11 @@ Index: kexec-tools-2.0.1/kexec/kexec.c
if (line) {
/* strip newline */
+- *(line + strlen(line) - 1) = 0;
++ line[strlen(line) - 1] = '\0';
+
+ remove_parameter(line, "BOOT_IMAGE");
+ if (kexec_flags & KEXEC_ON_CRASH)
Index: kexec-tools-2.0.1/kexec/arch/arm/kexec-zImage-arm.c
===================================================================