aboutsummaryrefslogtreecommitdiffstats
path: root/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch
diff options
context:
space:
mode:
authorAndrea Adami <andrea.adami@gmail.com>2013-05-13 01:22:23 +0200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2013-05-13 09:50:24 +0100
commit97957e5cee9a797d3e05c1a8848338a033f40770 (patch)
tree59351568b51e711b80ca3fff348e61d9079eaf01 /meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch
parent06318f320803814ac7f2827473a8e46a8eb0d8cb (diff)
downloadmeta-openembedded-contrib-97957e5cee9a797d3e05c1a8848338a033f40770.tar.gz
meta-openembedded-contrib-97957e5cee9a797d3e05c1a8848338a033f40770.tar.bz2
meta-openembedded-contrib-97957e5cee9a797d3e05c1a8848338a033f40770.zip
kexec-tools-klibc_2.0.2: refactor and extend patches for building
* some old patches apparently unneeded have been removed * patches are now better split * fix build for x86 and x86-64 * tested with qemuarm, qemuppc, qemumips, qemux86, qemux86-64 Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Diffstat (limited to 'meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch')
-rw-r--r--meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch
new file mode 100644
index 0000000000..14f4d2ada9
--- /dev/null
+++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch
@@ -0,0 +1,27 @@
+--- a/kexec/arch/i386/x86-linux-setup.c
++++ b/kexec/arch/i386/x86-linux-setup.c
+@@ -176,6 +176,8 @@ static int file_scanf(const char *dir, c
+ FILE *fp;
+ int retno;
+ char filename[PATH_MAX];
++ long line_size = MAX_LINE;
++ char *line;
+
+ snprintf(filename, PATH_MAX, "%s/%s", dir, file);
+ filename[PATH_MAX-1] = 0;
+@@ -186,7 +188,14 @@ static int file_scanf(const char *dir, c
+ }
+
+ va_start(argptr, scanf_line);
+- retno = vfscanf(fp, scanf_line, argptr);
++
++ line = xmalloc(sizeof(line) * line_size);
++ while(fgets(line, sizeof(line), fp) != 0 ) {
++ line_size += MAX_LINE;
++ line = xrealloc(line,line_size);
++ }
++ retno = vsscanf(line, scanf_line, argptr);
++
+ va_end(argptr);
+
+ fclose(fp);