aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2022-11-02 13:24:26 -0700
committerPaul Eggert2022-11-02 13:25:11 -0700
commit05f5d978ae70c4849a5c47865d62301d27317a8a (patch)
tree73b8cd558c85f42bcf4daf9c7d18e45738d8ed58 /src
parent195f0e00d743e59c2e5ab0a6fa0ac564e6221578 (diff)
downloademacs-05f5d978ae70c4849a5c47865d62301d27317a8a.tar.gz
emacs-05f5d978ae70c4849a5c47865d62301d27317a8a.zip
Initialize child signal handling before posix_spawn too.
Problem reported by Tino Calancha (Bug#58960). * src/callproc.c (call_process): Initialize SIGCHLD handling before possibly creating a child with emacs_span. This need not be in the critical section that calls emacs_spawn, so do it outside the critical section. * src/process.c (child_signal_init): Now extern.
Diffstat (limited to 'src')
-rw-r--r--src/callproc.c1
-rw-r--r--src/lisp.h1
-rw-r--r--src/process.c3
3 files changed, 3 insertions, 2 deletions
diff --git a/src/callproc.c b/src/callproc.c
index 4d4b86629cf..f9f840e5440 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -648,6 +648,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int filefd,
648 648
649#ifndef MSDOS 649#ifndef MSDOS
650 650
651 child_signal_init ();
651 block_input (); 652 block_input ();
652 block_child_signal (&oldset); 653 block_child_signal (&oldset);
653 654
diff --git a/src/lisp.h b/src/lisp.h
index d87f9549382..eafa241adfe 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4915,6 +4915,7 @@ extern bool running_asynch_code;
4915 4915
4916/* Defined in process.c. */ 4916/* Defined in process.c. */
4917struct Lisp_Process; 4917struct Lisp_Process;
4918extern void child_signal_init (void);
4918extern void kill_buffer_processes (Lisp_Object); 4919extern void kill_buffer_processes (Lisp_Object);
4919extern int wait_reading_process_output (intmax_t, int, int, bool, Lisp_Object, 4920extern int wait_reading_process_output (intmax_t, int, int, bool, Lisp_Object,
4920 struct Lisp_Process *, int); 4921 struct Lisp_Process *, int);
diff --git a/src/process.c b/src/process.c
index 358899cdede..5144c5d6c92 100644
--- a/src/process.c
+++ b/src/process.c
@@ -292,7 +292,6 @@ static int child_signal_read_fd = -1;
292 descriptor to notify `wait_reading_process_output' of process 292 descriptor to notify `wait_reading_process_output' of process
293 status changes. */ 293 status changes. */
294static int child_signal_write_fd = -1; 294static int child_signal_write_fd = -1;
295static void child_signal_init (void);
296#ifndef WINDOWSNT 295#ifndef WINDOWSNT
297static void child_signal_read (int, void *); 296static void child_signal_read (int, void *);
298#endif 297#endif
@@ -7323,7 +7322,7 @@ process has been transmitted to the serial port. */)
7323 7322
7324/* Set up `child_signal_read_fd' and `child_signal_write_fd'. */ 7323/* Set up `child_signal_read_fd' and `child_signal_write_fd'. */
7325 7324
7326static void 7325void
7327child_signal_init (void) 7326child_signal_init (void)
7328{ 7327{
7329 /* Either both are initialized, or both are uninitialized. */ 7328 /* Either both are initialized, or both are uninitialized. */