Remove unneccessary includes in kexec/crashdump.c

Cc: Magnus Damm <[EMAIL PROTECTED]>
Signed-Off-By: Simon Horman <[EMAIL PROTECTED]>

Index: kexec-tools-unstable/kexec/crashdump.c
===================================================================
--- kexec-tools-unstable.orig/kexec/crashdump.c 2006-11-16 17:04:51.000000000 
+0900
+++ kexec-tools-unstable/kexec/crashdump.c      2006-11-16 17:05:58.000000000 
+0900
@@ -20,15 +20,12 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <limits.h>
-#include <elf.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include "kexec.h"
-#include "crashdump.h"
 
 /* Returns the physical address of start of crash notes buffer for a cpu. */
 int get_crash_notes_per_cpu(int cpu, uint64_t *addr)
@@ -41,6 +38,7 @@
        unsigned long long temp;
        int status = -1;
        int fopen_errno;
+       int stat_errno;
 
        *addr = 0;
 
@@ -52,14 +50,15 @@
                        die(stderr, "Could not open \"%s\": %s\n",
                                crash_notes, strerror(fopen_errno));
                if (!stat("/sys/devices", &cpu_stat)) {
+                       stat_errno = errno;
                        fprintf(stderr, "Could not open \"%s\": %s\n",
                                crash_notes, strerror(fopen_errno));
-                       if (errno == ENOENT)
+                       if (stat_errno == ENOENT)
                                die("\"/sys/devices\" does not exist. "
                                    "Sysfs does not seem to be mounted. "
                                    "Try mounting sysfs.\n");
                        die("Could not open \"/sys/devices\": %s\n",
-                           crash_notes, strerror(errno));
+                           crash_notes, strerror(stat_errno));
                }
                /* CPU is not physically present.*/
                return -1;
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to