 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-09-26 01:58:53.545624148 +0200
++++ kexec-tools-2.0.1/kexec/kexec.c	2009-10-05 23:19:39.000000000 +0200
 @@ -38,9 +38,9 @@
 
  #include "config.h"

 #include <sha256.h>
 #include "kexec.h"
 #include "kexec-syscall.h"
@@ -555,6 +555,6 @@
 }

-#if HAVE_LIBZ

 char *slurp_decompress_file(const char *filename, off_t *r_size)
 {
	gzFile fp;
@@ -935,11 +935,19 @@
 {
	int ret;
	FILE *fp;
+	char *endptr;
+	char *line = NULL;

	fp = fopen("/sys/kernel/kexec_loaded", "r");
	if (fp == NULL)
		return -1;
-	fscanf(fp, "%d", &ret);
+/*	fscanf(fp, "%d", &ret); */
+
+	if ( NULL == fgets(line, sizeof(line), fp) ) {
+		return -1;
+	ret = strtol(line, &endptr, 10);
+	}
+
	fclose(fp);
	return ret;
 }
@@ -994,9 +1002,14 @@

	fp = fopen("/proc/cmdline", "r");
	if (!fp)
-		die("Could not read /proc/cmdline.");
-	getline(&line, &len, fp);
+		die("Could not open /proc/cmdline.");
+
+	if ( NULL == fgets(line, sizeof(line), fp) ) {
+		die("Can't read /proc/cmdline.");
+
+/* 	getline(&line, &len, fp); */
	fclose(fp);
+	}

	if (line) {
		/* strip newline */

Index: kexec-tools-2.0.1/kexec/arch/arm/kexec-zImage-arm.c
===================================================================
