# HG changeset patch # User Richard M. Stallman # Date 1031801339 0 # Node ID 16b9af83e7d379db5ccce9832fef8619d4e41f04 # Parent 8871e67384e45e1214cdca6ff1e858e2440afaa1 Don't use report_file_error; do it by hand using dlerror. diff -r 8871e67384e4 -r 16b9af83e7d3 src/unexsol.c --- a/src/unexsol.c Thu Sep 12 03:27:40 2002 +0000 +++ b/src/unexsol.c Thu Sep 12 03:28:59 2002 +0000 @@ -10,8 +10,22 @@ unexec (char *new_name, char *old_name, unsigned int data_start, unsigned int bss_start, unsigned int entry_address) { - if (dldump (0, new_name, RTLD_MEMORY)) - report_file_error ("Cannot unexec", Fcons (build_string (new_name), Qnil)); + Lisp_Object data; + Lisp_Object errstring; + + if (! dldump (0, new_name, RTLD_MEMORY)) + return 0; - return 0; + data = Fcons (build_string (new_name), Qnil); + synchronize_system_messages_locale (); + errstring = code_convert_string_norecord (build_string (dlerror ()), + Vlocale_coding_system, 0); + + /* System error messages are capitalized. Downcase the initial + unless it is followed by a slash. */ + if (SREF (errstring, 1) != '/') + SSET (errstring, 0, DOWNCASE (SREF (errstring, 0))); + + Fsignal (Qfile_error, + Fcons (build_string ("Cannot unexec"), Fcons (errstring, data))); }