Commit 5bda49c6 authored by Richard M. Stallman's avatar Richard M. Stallman

(Qusr1_signal, Qusr2_signal): New variables.

(syms_of_emacs): Init and staticpro them.
(handle_USR1_signal): Don't run any code, just queue up an event.
(handle_USR2_signal): Likewise.
parent 7cc45a35
...@@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -45,6 +45,7 @@ Boston, MA 02111-1307, USA. */
#include "blockinput.h" #include "blockinput.h"
#include "syssignal.h" #include "syssignal.h"
#include "process.h" #include "process.h"
#include "termhooks.h"
#include "keyboard.h" #include "keyboard.h"
#ifdef HAVE_SETRLIMIT #ifdef HAVE_SETRLIMIT
...@@ -116,6 +117,8 @@ Lisp_Object Vsystem_configuration_options; ...@@ -116,6 +117,8 @@ Lisp_Object Vsystem_configuration_options;
Lisp_Object Qfile_name_handler_alist; Lisp_Object Qfile_name_handler_alist;
Lisp_Object Qusr1_signal, Qusr2_signal;
/* If non-zero, emacs should not attempt to use an window-specific code, /* If non-zero, emacs should not attempt to use an window-specific code,
but instead should use the virtual terminal under which it was started */ but instead should use the virtual terminal under which it was started */
int inhibit_window_system; int inhibit_window_system;
...@@ -180,40 +183,38 @@ int fatal_error_code; ...@@ -180,40 +183,38 @@ int fatal_error_code;
int fatal_error_in_progress; int fatal_error_in_progress;
#ifdef SIGUSR1 #ifdef SIGUSR1
int SIGUSR1_in_progress=0;
SIGTYPE SIGTYPE
handle_USR1_signal (sig) handle_USR1_signal (sig)
int sig; int sig;
{ {
if (! SIGUSR1_in_progress) struct input_event buf;
{
SIGUSR1_in_progress = 1; buf.kind = non_ascii_keystroke;
buf.code = Qusr1_signal;
if (!NILP (Vrun_hooks) && !noninteractive) buf.frame_or_window = Fselected_frame ();
call1 (Vrun_hooks, intern ("signal-USR1-hook")); buf.modifiers = 0;
buf.timestamp = 0;
SIGUSR1_in_progress = 0;
} kbd_buffer_store_event (&buf);
} }
#endif /* SIGUSR1 */
#ifdef SIGUSR2 #ifdef SIGUSR2
int SIGUSR2_in_progress=0;
SIGTYPE SIGTYPE
handle_USR2_signal (sig) handle_USR2_signal (sig)
int sig; int sig;
{ {
if (! SIGUSR2_in_progress) struct input_event buf;
{
SIGUSR2_in_progress = 1; buf.kind = non_ascii_keystroke;
buf.code = Qusr2_signal;
if (!NILP (Vrun_hooks) && !noninteractive) buf.frame_or_window = Fselected_frame ();
call1 (Vrun_hooks, intern ("signal-USR2-hook")); buf.modifiers = 0;
buf.timestamp = 0;
SIGUSR2_in_progress = 0;
} kbd_buffer_store_event (&buf);
} }
#endif #endif /* SIGUSR2 */
#endif
/* Handle bus errors, illegal instruction, etc. */ /* Handle bus errors, illegal instruction, etc. */
SIGTYPE SIGTYPE
...@@ -1859,6 +1860,11 @@ syms_of_emacs () ...@@ -1859,6 +1860,11 @@ syms_of_emacs ()
Qfile_name_handler_alist = intern ("file-name-handler-alist"); Qfile_name_handler_alist = intern ("file-name-handler-alist");
staticpro (&Qfile_name_handler_alist); staticpro (&Qfile_name_handler_alist);
Qusr1_signal = intern ("usr1-signal");
staticpro (&Qusr1_signal);
Qusr2_signal = intern ("usr2-signal");
staticpro (&Qusr2_signal);
#ifndef CANNOT_DUMP #ifndef CANNOT_DUMP
#ifdef HAVE_SHM #ifdef HAVE_SHM
defsubr (&Sdump_emacs_data); defsubr (&Sdump_emacs_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment