]> git.eshelyaron.com Git - emacs.git/commit
Allocate environment block before forking.
authorPhilipp Stephani <phst@google.com>
Wed, 23 Dec 2020 14:55:23 +0000 (15:55 +0100)
committerPhilipp Stephani <phst@google.com>
Wed, 23 Dec 2020 14:55:23 +0000 (15:55 +0100)
commit95334ee79ab60c0910a5528e586a24d11f91743b
tree2938b1215c75c61cdead9a29d6bea6fd8ae54585
parent3cbd4169d6dd370b4fa8180fc2adfbf426f57837
Allocate environment block before forking.

While 'child_setup' carefully avoids calls to async-signal-unsafe
functions like 'malloc', it seems simpler and less brittle to use
normal allocation outside the critical section between 'fork' and
'exec'.

* src/callproc.c (make_environment_block): New function to create the
environment block for subprocesses.  Code largely extracted from
'child_setup' and adapted to use 'xmalloc' instead of 'alloca'.
(child_setup): Remove environment block allocation in favor of
passing the environment block as command-line argument.
(call_process): Adapt to new calling convention.

* src/process.c (create_process): Adapt to new calling convention.
src/callproc.c
src/lisp.h
src/process.c