X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/bacba3c26522ef297662bace31947d3e4f47c87a..c35e776245915b96e9e80dec5354d087fcdc18ff:/src/unexaix.c diff --git a/src/unexaix.c b/src/unexaix.c index 45b3ca667b..c97d5cae2a 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -1,5 +1,5 @@ /* Dump an executable image. - Copyright (C) 1985-1988, 1999, 2001-2013 Free Software Foundation, + Copyright (C) 1985-1988, 1999, 2001-2014 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -94,13 +94,10 @@ static int pagemask; static _Noreturn void report_error (const char *file, int fd) { + int err = errno; if (fd) - { - int failed_errno = errno; - emacs_close (fd); - errno = failed_errno; - } - report_file_error ("Cannot unexec", Fcons (build_string (file), Qnil)); + emacs_close (fd); + report_file_errno ("Cannot unexec", build_string (file), err); } #define ERROR0(msg) report_error_1 (new, msg) @@ -382,7 +379,7 @@ copy_text_and_data (int new) char *ptr; lseek (new, text_scnptr, SEEK_SET); - ptr = _text + text_scnptr; + ptr = _text; end = ptr + f_ohdr.tsize; write_segment (new, ptr, end); @@ -609,7 +606,7 @@ unrelocate_symbols (int new, int a_out, PERROR (a_name); } - p = (int *) (ldrel.l_vaddr + d_reloc); + p = (int *) (intptr_t) (ldrel.l_vaddr + d_reloc); switch (ldrel.l_symndx) { case SYMNDX_TEXT: