diff options
author | Mike Gran <spk121@yahoo.com> | 2017-03-03 09:50:27 -0800 |
---|---|---|
committer | Mike Gran <spk121@yahoo.com> | 2017-03-03 09:50:27 -0800 |
commit | 8dc0e8d622cf699885c4b1b4277cd7aab700386d (patch) | |
tree | 1146966e33e8f836716a7206de4e0f17b3adc536 /libguile | |
parent | 24da8084addc311a9213a04590619cc925585a95 (diff) |
Fix regression in non-mmap fallback elf loader
* libguile/loader.c [!HAVE_SYS_MMAN_H] (map_file_contents): updated
variables and function calls to the current names
Diffstat (limited to 'libguile')
-rw-r--r-- | libguile/loader.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libguile/loader.c b/libguile/loader.c index a4c3e884b..558a722ea 100644 --- a/libguile/loader.c +++ b/libguile/loader.c @@ -480,7 +480,7 @@ map_file_contents (int fd, size_t len, int *is_read_only) SCM_SYSERROR; *is_read_only = 1; #else - if (lseek (fd, 0, SEEK_START) < 0) + if (lseek (fd, 0, SEEK_SET) < 0) { int errno_save = errno; (void) close (fd); @@ -491,15 +491,15 @@ map_file_contents (int fd, size_t len, int *is_read_only) /* Given that we are using the read fallback, optimistically assume that the .go files were made with 8-byte alignment. alignment. */ - data = malloc (end); + data = malloc (len); if (!data) { (void) close (fd); scm_misc_error (FUNC_NAME, "failed to allocate ~A bytes", - scm_list_1 (scm_from_size_t (end))); + scm_list_1 (scm_from_size_t (len))); } - if (full_read (fd, data, end) != end) + if (full_read (fd, data, len) != len) { int errno_save = errno; (void) close (fd); @@ -512,11 +512,11 @@ map_file_contents (int fd, size_t len, int *is_read_only) /* If our optimism failed, fall back. */ { - unsigned alignment = sniff_elf_alignment (data, end); + unsigned alignment = elf_alignment (data, len); if (alignment != 8) { - char *copy = copy_and_align_elf_data (data, end, alignment); + char *copy = copy_and_align_elf_data (data, len); free (data); data = copy; } |