X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Funexec.c;h=ae2f945d917e7da9bd525397ffd6d927f4ebdc0e;hb=3aca7317dd930beecbddba646284279744087e69;hp=14ed085ee9c0ddf559ef00dee74b488d6798b80d;hpb=b267e52aa03bee2c488c8a78824d96cf2d9a6ccc;p=chise%2Fxemacs-chise.git- diff --git a/src/unexec.c b/src/unexec.c index 14ed085..ae2f945 100644 --- a/src/unexec.c +++ b/src/unexec.c @@ -136,7 +136,7 @@ before writing it (above and beyond the number of bytes of actual program text). HDR's standard fields are already correct, except that this adjustment to the `a_text' field has not yet been made; thus, the amount of offset can depend on the data in the file. - + * A_TEXT_SEEK(HDR) If defined, this macro specifies the number of bytes to seek into the @@ -186,18 +186,12 @@ pointer looks like an int) but not on all machines. # undef _POSIX_SOURCE # endif -# if defined(__lucid) && !defined(__STDC_EXTENDED__) -# define __STDC_EXTENDED__ 1 -# endif - # include # include # include # include - -# ifdef __lucid -# include -# endif +# include +# include #endif @@ -288,7 +282,7 @@ static long data_scnptr; #ifdef __STDC__ #ifndef __sys_stdtypes_h -#ifndef _PTRDIFF_T +#if !defined(_PTRDIFF_T) && !defined(_BSD_PTRDIFF_T_) typedef long ptrdiff_t; #endif #endif @@ -372,14 +366,12 @@ static int pagemask; #include "lisp.h" static void -report_error (file, fd) - CONST char *file; - int fd; +report_error (const char *file, int fd) { if (fd) close (fd); report_file_error ("Cannot unexec", - Fcons (build_ext_string (file, FORMAT_FILENAME), Qnil)); + Fcons (build_ext_string (file, Qfile_name), Qnil)); } #endif /* emacs */ @@ -390,7 +382,7 @@ report_error (file, fd) static void report_error_1 (fd, msg, a1, a2) int fd; - CONST char *msg; + const char *msg; int a1, a2; { close (fd); @@ -442,7 +434,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address) { close (new); /* unlink (new_name); / * Failed, unlink new a.out */ - return -1; + return -1; } close (new); @@ -968,7 +960,7 @@ copy_text_and_data (int new, int a_out) #ifdef RISCiX - /* Acorn's RISC-iX has a wacky way of initialising the position of the heap. + /* Acorn's RISC-iX has a wacky way of initializing the position of the heap. * There is a little table in crt0.o that is filled at link time with * the min and current brk positions, among other things. When start * runs, it copies the table to where these parameters live during @@ -997,7 +989,7 @@ copy_text_and_data (int new, int a_out) char c; int mcount_address, mcount_offset, count; extern char *_execname; - + /* The use of _execname is incompatible with RISCiX 1.1 */ sprintf (command, "nm %s | fgrep mcount", _execname); @@ -1017,7 +1009,7 @@ copy_text_and_data (int new, int a_out) { sprintf (errbuf, "Failed to execute the command '%s'\n", command); PERROR (errbuf); - } + } sscanf(address_text, "%x", &mcount_address); ptr = (char *) unexec_text_start; @@ -1075,7 +1067,6 @@ write_segment (new, ptr, end) #if 0 char buf[80]; #endif - extern int errno; /* This is the normal amount to write at once. It is the size of block that NFS uses. */ int writesize = 1 << 13;