summaryrefslogtreecommitdiff
path: root/src/pdumper.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-09-11 11:26:07 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-09-11 11:27:14 -0700
commit5fafa40d076ee24baf880e97d4290b6196cf838a (patch)
tree03452b023e9777409d979932b53f9ef347601b76 /src/pdumper.h
parenta6daae7b3df3a964b3dcde85987c02fd0af66a89 (diff)
downloademacs-5fafa40d076ee24baf880e97d4290b6196cf838a.tar.gz
Improve checking of pdump load failures
* src/alloc.c (memory_full): Just report "memory exhausted" if failure occurs during initialization, since fancier recovery schemes are not likely to work when not initialized. * src/emacs.c (dump_error_to_string): Accept int, not enum pdumper_load_result, since the result might not fit in the enum. Use strerror if it was derived from errno. This is for better diagnostics of pdump load failures. (load_pdump_find_executable): Return char *, not enum. 2nd arg is now pointer to buffer size, rather than pointer to pointer to buffer. All callers changed. Use Emacs allocator since they should now be OK even during early startup. Use check_executable instead access, to use effective rather than real permissions. (load_pdump): Return void since callers ignore result. Use int where enum could be too narrow. Use heap rather than stack for possibly-long string. Prefer ptrdiff_t to size_t. * src/fileio.c (check_executable): Now extern. * src/pdumper.c (pdumper_load): Return int that may have errno added to it, for better diagnostics when loads fail.
Diffstat (limited to 'src/pdumper.h')
-rw-r--r--src/pdumper.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pdumper.h b/src/pdumper.h
index 83c094f3caa..31b0d53b073 100644
--- a/src/pdumper.h
+++ b/src/pdumper.h
@@ -124,10 +124,10 @@ enum pdumper_load_result
PDUMPER_LOAD_FAILED_DUMP,
PDUMPER_LOAD_OOM,
PDUMPER_LOAD_VERSION_MISMATCH,
- PDUMPER_LOAD_ERROR,
+ PDUMPER_LOAD_ERROR /* Must be last, as errno may be added. */
};
-enum pdumper_load_result pdumper_load (const char *dump_filename);
+int pdumper_load (const char *dump_filename);
struct pdumper_loaded_dump
{