Change unexec implementations to match prototype.

This commit is contained in:
Paul Eggert 2011-03-17 11:41:30 -07:00
parent a3a6c54ec7
commit 381259ef0d
8 changed files with 10 additions and 24 deletions

View file

@ -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.

View file

@ -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);
}

View file

@ -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 */

View file

@ -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);
}

View file

@ -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. */

View file

@ -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);
}

View file

@ -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)));
}

View file

@ -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 */