return "could not open file";
case PDUMPER_LOAD_BAD_FILE_TYPE:
return "not a dump file";
+ case PDUMPER_LOAD_FAILED_DUMP:
+ return "dump file is result of failed dump attempt";
case PDUMPER_LOAD_VERSION_MISMATCH:
return "not built for this Emacs executable";
default:
sizeof (*header)) < sizeof (*header))
goto out;
- err = PDUMPER_LOAD_BAD_FILE_TYPE;
if (memcmp (header->magic, dump_magic, sizeof (dump_magic)) != 0)
- goto out;
+ {
+ if (header->magic[0] == '!' &&
+ ((header->magic[0] = dump_magic[0]),
+ memcmp (header->magic, dump_magic, sizeof (dump_magic)) == 0))
+ {
+ err = PDUMPER_LOAD_FAILED_DUMP;
+ goto out;
+ }
+ err = PDUMPER_LOAD_BAD_FILE_TYPE;
+ goto out;
+ }
err = PDUMPER_LOAD_VERSION_MISMATCH;
verify (sizeof (header->fingerprint) == sizeof (fingerprint));
PDUMPER_NOT_LOADED /* Not returned: useful for callers */,
PDUMPER_LOAD_FILE_NOT_FOUND,
PDUMPER_LOAD_BAD_FILE_TYPE,
+ PDUMPER_LOAD_FAILED_DUMP,
PDUMPER_LOAD_OOM,
PDUMPER_LOAD_VERSION_MISMATCH,
PDUMPER_LOAD_ERROR,