aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2019-04-03 20:30:23 +0300
committerEli Zaretskii2019-04-03 20:30:23 +0300
commitb29b79efd9752caf1e99273575a00b6769ddad56 (patch)
treeb7f8157541214a0f60634ba0dc3612d1642c491b /src
parent9df0b8d166a3b3805c20e10885f15f9e35de7ec6 (diff)
downloademacs-b29b79efd9752caf1e99273575a00b6769ddad56.tar.gz
emacs-b29b79efd9752caf1e99273575a00b6769ddad56.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/pdumper.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/pdumper.c b/src/pdumper.c
index 53a10b62b3f..7fabfa771ce 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -495,6 +495,7 @@ struct dump_context
495 495
496 Lisp_Object old_purify_flag; 496 Lisp_Object old_purify_flag;
497 Lisp_Object old_post_gc_hook; 497 Lisp_Object old_post_gc_hook;
498 Lisp_Object old_process_environment;
498 499
499#ifdef REL_ALLOC 500#ifdef REL_ALLOC
500 bool blocked_ralloc; 501 bool blocked_ralloc;
@@ -3593,6 +3594,8 @@ dump_unwind_cleanup (void *data)
3593 r_alloc_inhibit_buffer_relocation (0); 3594 r_alloc_inhibit_buffer_relocation (0);
3594#endif 3595#endif
3595 Vpurify_flag = ctx->old_purify_flag; 3596 Vpurify_flag = ctx->old_purify_flag;
3597 Vpost_gc_hook = ctx->old_post_gc_hook;
3598 Vprocess_environment = ctx->old_process_environment;
3596} 3599}
3597 3600
3598/* Return DUMP_OFFSET, making sure it is within the heap. */ 3601/* Return DUMP_OFFSET, making sure it is within the heap. */
@@ -4024,12 +4027,6 @@ types. */)
4024 Lisp_Object symbol = intern ("command-line-processed"); 4027 Lisp_Object symbol = intern ("command-line-processed");
4025 specbind (symbol, Qnil); 4028 specbind (symbol, Qnil);
4026 4029
4027 /* Reset process-environment -- this is for when they re-dump a
4028 pdump-restored emacs, since set_initial_environment wants always
4029 to cons it from scratch. */
4030 Vprocess_environment = Qnil;
4031 garbage_collect ();
4032
4033 CHECK_STRING (filename); 4030 CHECK_STRING (filename);
4034 filename = Fexpand_file_name (filename, Qnil); 4031 filename = Fexpand_file_name (filename, Qnil);
4035 filename = ENCODE_FILE (filename); 4032 filename = ENCODE_FILE (filename);
@@ -4091,6 +4088,12 @@ types. */)
4091 ctx->old_post_gc_hook = Vpost_gc_hook; 4088 ctx->old_post_gc_hook = Vpost_gc_hook;
4092 Vpost_gc_hook = Qnil; 4089 Vpost_gc_hook = Qnil;
4093 4090
4091 /* Reset process-environment -- this is for when they re-dump a
4092 pdump-restored emacs, since set_initial_environment wants always
4093 to cons it from scratch. */
4094 ctx->old_process_environment = Vprocess_environment;
4095 Vprocess_environment = Qnil;
4096
4094 ctx->fd = emacs_open (SSDATA (filename), 4097 ctx->fd = emacs_open (SSDATA (filename),
4095 O_RDWR | O_TRUNC | O_CREAT, 0666); 4098 O_RDWR | O_TRUNC | O_CREAT, 0666);
4096 if (ctx->fd < 0) 4099 if (ctx->fd < 0)