emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 160b4c295d8: ; * src/process.c (child_signal_notify): Avoid compi


From: Eli Zaretskii
Subject: master 160b4c295d8: ; * src/process.c (child_signal_notify): Avoid compiler warning (bug#65919).
Date: Fri, 15 Sep 2023 02:05:43 -0400 (EDT)

branch: master
commit 160b4c295d8975755d4a8cc4ba6b6b75a549ed3c
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; * src/process.c (child_signal_notify): Avoid compiler warning (bug#65919).
---
 src/process.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/process.c b/src/process.c
index 7410256dae9..2376d0f288d 100644
--- a/src/process.c
+++ b/src/process.c
@@ -7415,10 +7415,14 @@ child_signal_notify (void)
   int fd = child_signal_write_fd;
   eassert (0 <= fd);
   char dummy = 0;
-  if (emacs_write (fd, &dummy, 1) != 1)
-    /* This call is commented out.  It calls `emacs_perror', which in
-       turn invokes a localized version of strerror that is not
-       reentrant and must not be called within a signal handler:
+  /* We used to error out here, like this:
+
+     if (emacs_write (fd, &dummy, 1) != 1)
+       emacs_perror ("writing to child signal FD");
+
+     But this calls `emacs_perror', which in turn invokes a localized
+     version of strerror, which is not reentrant and must not be
+     called within a signal handler:
 
        __lll_lock_wait_private () at /lib64/libc.so.6
        malloc () at /lib64/libc.so.6
@@ -7432,8 +7436,10 @@ child_signal_notify (void)
        deliver_process_signal (sig=17, handler=0x6186b0>)
        <signal handler called> () at /lib64/libc.so.6
        _int_malloc () at /lib64/libc.so.6
-       in malloc () at /lib64/libc.so.6.  */
-    /* emacs_perror ("writing to child signal FD") */;
+       in malloc () at /lib64/libc.so.6.
+
+     So we no longer check errors of emacs_write here.  */
+  emacs_write (fd, &dummy, 1);
 #endif
 }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]