[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 05f5d978ae: Initialize child signal handling before posix_spawn t
From: |
Paul Eggert |
Subject: |
master 05f5d978ae: Initialize child signal handling before posix_spawn too. |
Date: |
Wed, 2 Nov 2022 16:25:32 -0400 (EDT) |
branch: master
commit 05f5d978ae70c4849a5c47865d62301d27317a8a
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>
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.
---
src/callproc.c | 1 +
src/lisp.h | 1 +
src/process.c | 3 +--
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/callproc.c b/src/callproc.c
index 4d4b86629c..f9f840e544 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -648,6 +648,7 @@ call_process (ptrdiff_t nargs, Lisp_Object *args, int
filefd,
#ifndef MSDOS
+ child_signal_init ();
block_input ();
block_child_signal (&oldset);
diff --git a/src/lisp.h b/src/lisp.h
index d87f954938..eafa241adf 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4915,6 +4915,7 @@ extern bool running_asynch_code;
/* Defined in process.c. */
struct Lisp_Process;
+extern void child_signal_init (void);
extern void kill_buffer_processes (Lisp_Object);
extern int wait_reading_process_output (intmax_t, int, int, bool, Lisp_Object,
struct Lisp_Process *, int);
diff --git a/src/process.c b/src/process.c
index 358899cded..5144c5d6c9 100644
--- a/src/process.c
+++ b/src/process.c
@@ -292,7 +292,6 @@ static int child_signal_read_fd = -1;
descriptor to notify `wait_reading_process_output' of process
status changes. */
static int child_signal_write_fd = -1;
-static void child_signal_init (void);
#ifndef WINDOWSNT
static void child_signal_read (int, void *);
#endif
@@ -7323,7 +7322,7 @@ process has been transmitted to the serial port. */)
/* Set up `child_signal_read_fd' and `child_signal_write_fd'. */
-static void
+void
child_signal_init (void)
{
/* Either both are initialized, or both are uninitialized. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 05f5d978ae: Initialize child signal handling before posix_spawn too.,
Paul Eggert <=