Merge: Fix more problems found by GCC 4.5.2's static checks.
[bpt/emacs.git] / src / unexsol.c
CommitLineData
acb46fd4
RS
1/* Trivial unexec for Solaris. */
2
3#include <config.h>
ce701a33
PE
4#include "unexec.h"
5
acb46fd4 6#include <dlfcn.h>
d7306fe6 7#include <setjmp.h>
acb46fd4
RS
8
9#include "lisp.h"
dad0e4f4
MR
10#include "buffer.h"
11#include "charset.h"
12#include "coding.h"
acb46fd4
RS
13
14int
dd5ecd6b 15unexec (const char *new_name, const char *old_name)
acb46fd4 16{
fdebad64
RS
17 Lisp_Object data;
18 Lisp_Object errstring;
acb46fd4 19
fdebad64
RS
20 if (! dldump (0, new_name, RTLD_MEMORY))
21 return 0;
22
23 data = Fcons (build_string (new_name), Qnil);
24 synchronize_system_messages_locale ();
25 errstring = code_convert_string_norecord (build_string (dlerror ()),
26 Vlocale_coding_system, 0);
27
dbfcf224 28 xsignal (Qfile_error,
fdebad64 29 Fcons (build_string ("Cannot unexec"), Fcons (errstring, data)));
acb46fd4 30}
ab5796a9 31