diff options
-rw-r--r-- | kexec/kexec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kexec/kexec.c b/kexec/kexec.c index ff024f3..b9f1816 100644 --- a/kexec/kexec.c +++ b/kexec/kexec.c @@ -26,7 +26,6 @@ #include <stdlib.h> #include <errno.h> #include <limits.h> -#include <sys/mman.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/reboot.h> @@ -553,12 +552,11 @@ char *slurp_file(const char *filename, off_t *r_size) if (err < 0) die("Can not seek to the begin of file %s: %s\n", filename, strerror(errno)); - buf = slurp_fd(fd, filename, size, &nread); } else { - size = nread = stats.st_size; - buf = mmap(NULL, size, - PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); + size = stats.st_size; } + + buf = slurp_fd(fd, filename, size, &nread); if (!buf) die("Cannot read %s", filename); |