1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-17 10:06:13 +00:00

Restore process-environment after portable dumping

* src/pdumper.c (struct dump_context): New member
old_process_environment.
(Fdump_emacs_portable): Record the original value of
process-environment.
(dump_unwind_cleanup): Restore the original values of
process-environment and post-gc-hook.
This commit is contained in:
Eli Zaretskii 2019-04-03 20:30:23 +03:00
parent 9df0b8d166
commit b29b79efd9

View File

@ -495,6 +495,7 @@ struct dump_context
Lisp_Object old_purify_flag;
Lisp_Object old_post_gc_hook;
Lisp_Object old_process_environment;
#ifdef REL_ALLOC
bool blocked_ralloc;
@ -3593,6 +3594,8 @@ dump_unwind_cleanup (void *data)
r_alloc_inhibit_buffer_relocation (0);
#endif
Vpurify_flag = ctx->old_purify_flag;
Vpost_gc_hook = ctx->old_post_gc_hook;
Vprocess_environment = ctx->old_process_environment;
}
/* Return DUMP_OFFSET, making sure it is within the heap. */
@ -4024,12 +4027,6 @@ types. */)
Lisp_Object symbol = intern ("command-line-processed");
specbind (symbol, Qnil);
/* Reset process-environment -- this is for when they re-dump a
pdump-restored emacs, since set_initial_environment wants always
to cons it from scratch. */
Vprocess_environment = Qnil;
garbage_collect ();
CHECK_STRING (filename);
filename = Fexpand_file_name (filename, Qnil);
filename = ENCODE_FILE (filename);
@ -4091,6 +4088,12 @@ types. */)
ctx->old_post_gc_hook = Vpost_gc_hook;
Vpost_gc_hook = Qnil;
/* Reset process-environment -- this is for when they re-dump a
pdump-restored emacs, since set_initial_environment wants always
to cons it from scratch. */
ctx->old_process_environment = Vprocess_environment;
Vprocess_environment = Qnil;
ctx->fd = emacs_open (SSDATA (filename),
O_RDWR | O_TRUNC | O_CREAT, 0666);
if (ctx->fd < 0)