GNU bug report logs - #12471
Avoid some signal-handling races, and simplify.

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Tue, 18 Sep 2012 23:42:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #41 received at 12471 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 12471 <at> debbugs.gnu.org, lekktu <at> gmail.com
Subject: Re: Avoid some signal-handling races, and simplify.
Date: Fri, 21 Sep 2012 11:13:47 -0700
On 09/21/2012 10:38 AM, Eli Zaretskii wrote:
> I see no way to do that in any place but where 'raise' is called,
> sorry.

Well I'm no Windows expert, but if I understand things correctly,
the following should do the trick, since it uses the same
pattern that the Windows code already uses for
'kill', 'signal', and 'sigaction'.  This approach should avoid
the macro problems that my earlier suggestion had.

=== modified file 'nt/ChangeLog'
--- nt/ChangeLog	2012-09-18 10:49:33 +0000
+++ nt/ChangeLog	2012-09-21 18:10:25 +0000
@@ -1,3 +1,7 @@
+2012-09-21  Paul Eggert  <eggert <at> cs.ucla.edu>
+
+	* inc/ms-w32.h (raise): New macro.
+
 2012-09-18  Eli Zaretskii  <eliz <at> gnu.org>
 
 	* configure.bat: Include stddef.h before gif_lib.h, to have size_t

=== modified file 'nt/inc/ms-w32.h'
--- nt/inc/ms-w32.h	2012-09-07 08:20:07 +0000
+++ nt/inc/ms-w32.h	2012-09-21 18:10:25 +0000
@@ -200,6 +200,7 @@
 /* Subprocess calls that are emulated.  */
 #define spawnve sys_spawnve
 #define wait    sys_wait
+#define raise   sys_raise
 #define kill    sys_kill
 #define signal  sys_signal
 

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2012-09-21 07:21:06 +0000
+++ src/ChangeLog	2012-09-21 18:10:25 +0000
@@ -124,6 +124,7 @@
 	(emacs_backtrace): Output backtrace for the appropriate thread,
 	which is not necessarily the main thread.
 	* syssignal.h: Include <stdbool.h>.
+	* w32proc.c (sys_raise): New function.
 	* xterm.c (x_connection_signal): Remove; no longer needed
 	now that we use sigaction.
 	(x_connection_closed): No need to mess with sigmask now.

=== modified file 'src/w32proc.c'
--- src/w32proc.c	2012-09-15 08:03:11 +0000
+++ src/w32proc.c	2012-09-21 18:10:25 +0000
@@ -1421,6 +1421,12 @@
 }
 
 int
+sys_raise (int sig)
+{
+  sys_kill (getpid (), sig);
+}
+
+int
 sys_kill (int pid, int sig)
 {
   child_process *cp;






This bug report was last modified 12 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.