Commit b29b79ef authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent 9df0b8d1
Pipeline #1151 failed with stage
in 60 minutes and 1 second
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment