From 381259ef0debba4c0bb07bb5473467c1d4d84223 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Mar 2011 11:41:30 -0700 Subject: [PATCH] Change unexec implementations to match prototype. --- src/ChangeLog | 1 + src/unexaix.c | 6 ++---- src/unexcoff.c | 5 +---- src/unexcw.c | 5 +---- src/unexhp9k800.c | 3 +-- src/unexmacosx.c | 4 +--- src/unexsol.c | 5 ++--- src/unexw32.c | 5 +---- 8 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d97969c24d..acc3f0308e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -36,6 +36,7 @@ * emacs.c [!defined CANNOT_DUMP]: Include unexec.h. * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c: * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h. + Change as necessary to match prototype in unexec.h. * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid shadowing. diff --git a/src/unexaix.c b/src/unexaix.c index 612d7c1fec..e6aad2db77 100644 --- a/src/unexaix.c +++ b/src/unexaix.c @@ -121,7 +121,8 @@ static void write_segment (int, char *, char *); * * driving logic. */ -int unexec (const char *new_name, const char *a_name) +void +unexec (const char *new_name, const char *a_name) { int new = -1, a_out = -1; @@ -141,14 +142,12 @@ int unexec (const char *new_name, const char *a_name) || unrelocate_symbols (new, a_out, a_name, new_name) < 0) { close (new); - return -1; } close (new); if (a_out >= 0) close (a_out); mark_x (new_name); - return 0; } /* **************************************************************** @@ -639,4 +638,3 @@ start_of_text (void) { return ((char *) 0x10000000); } - diff --git a/src/unexcoff.c b/src/unexcoff.c index 1efde1a9cb..03b0015e6b 100644 --- a/src/unexcoff.c +++ b/src/unexcoff.c @@ -524,7 +524,7 @@ adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name) * * driving logic. */ -int +void unexec (const char *new_name, const char *a_name) { int new = -1, a_out = -1; @@ -545,15 +545,12 @@ unexec (const char *new_name, const char *a_name) ) { close (new); - return -1; } close (new); if (a_out >= 0) close (a_out); mark_x (new_name); - return 0; } #endif /* not CANNOT_DUMP */ - diff --git a/src/unexcw.c b/src/unexcw.c index b5d72e6155..1202e04602 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -249,7 +249,7 @@ add_exe_suffix_if_necessary (const char *name, char *modified) return (modified); } -int +void unexec (const char *outfile, const char *infile) { char infile_buffer[FILENAME_MAX]; @@ -263,7 +263,6 @@ unexec (const char *outfile, const char *infile) { /* can only dump once */ printf ("You can only dump Emacs once on this platform.\n"); - return (1); } report_sheap_usage (1); @@ -298,6 +297,4 @@ unexec (const char *outfile, const char *infile) ret = close (fd_out); assert (ret == 0); - - return (0); } diff --git a/src/unexhp9k800.c b/src/unexhp9k800.c index 9889ffd63f..f27415a252 100644 --- a/src/unexhp9k800.c +++ b/src/unexhp9k800.c @@ -76,7 +76,7 @@ run_time_remap (ignored) /* Create a new a.out file, same as old but with current data space */ -int +void unexec (const char *new_name, /* name of the new a.out file to be created */ const char *old_name) /* name of the old a.out file */ { @@ -133,7 +133,6 @@ unexec (const char *new_name, /* name of the new a.out file to be created * /* Close the binary file */ close (old); close (new); - return 0; } /* Save current data space in the file, update header. */ diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 0df0bb8451..04e3edf463 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -1227,7 +1227,7 @@ dump_it (void) from it. The file names of the output and input files are outfile and infile, respectively. The three other parameters are ignored. */ -int +void unexec (const char *outfile, const char *infile) { if (in_dumped_exec) @@ -1258,7 +1258,6 @@ unexec (const char *outfile, const char *infile) dump_it (); close (outfd); - return 0; } @@ -1383,4 +1382,3 @@ unexec_free (void *ptr) else malloc_zone_free (emacs_zone, (unexec_malloc_header_t *) ptr - 1); } - diff --git a/src/unexsol.c b/src/unexsol.c index ae91c17085..ef1e34e6f0 100644 --- a/src/unexsol.c +++ b/src/unexsol.c @@ -11,14 +11,14 @@ #include "charset.h" #include "coding.h" -int +void unexec (const char *new_name, const char *old_name) { Lisp_Object data; Lisp_Object errstring; if (! dldump (0, new_name, RTLD_MEMORY)) - return 0; + return; data = Fcons (build_string (new_name), Qnil); synchronize_system_messages_locale (); @@ -28,4 +28,3 @@ unexec (const char *new_name, const char *old_name) xsignal (Qfile_error, Fcons (build_string ("Cannot unexec"), Fcons (errstring, data))); } - diff --git a/src/unexw32.c b/src/unexw32.c index c921cd657d..cd8211d6be 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -724,7 +724,7 @@ copy_executable_and_dump_data (file_data *p_infile, /* Dump out .data and .bss sections into a new executable. */ -int +void unexec (const char *new_name, const char *old_name) { file_data in_file, out_file; @@ -820,9 +820,6 @@ unexec (const char *new_name, const char *old_name) close_file_data (&in_file); close_file_data (&out_file); - - return 0; } /* eof */ - -- 2.20.1