From b6f960a0ea4a19ed3dc8a6c5e34cf1d2e02b4bb9 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 10 Jan 2013 23:47:57 -0800 Subject: [PATCH] Fix SIGDANGER handlers, for AIX. * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]: Move handlers here from emacs.c; they were out of place. Fixes: debbugs:13408 --- src/ChangeLog | 6 ++++++ src/emacs.c | 19 ------------------- src/sysdep.c | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 919e9e7de43..696a70fc08d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-01-11 Paul Eggert + + Fix SIGDANGER handlers, for AIX (Bug#13408). + * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]: + Move handlers here from emacs.c; they were out of place. + 2013-01-05 Eli Zaretskii * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead diff --git a/src/emacs.c b/src/emacs.c index a7b17a9905c..c0c230ef3dd 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -346,25 +346,6 @@ terminate_due_to_signal (int sig, int backtrace_limit) /* This shouldn't be executed, but it prevents a warning. */ exit (1); } - -#ifdef SIGDANGER - -/* Handler for SIGDANGER. */ -static void -handle_danger_signal (int sig) -{ - malloc_warning ("Operating system warns that virtual memory is running low.\n"); - - /* It might be unsafe to call do_auto_save now. */ - force_auto_save_soon (); -} - -static void -deliver_danger_signal (int sig) -{ - deliver_process_signal (sig, handle_danger_signal); -} -#endif /* Code for dealing with Lisp access to the Unix command line. */ diff --git a/src/sysdep.c b/src/sysdep.c index 960c13b8d84..47a14bdba35 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1663,6 +1663,25 @@ deliver_arith_signal (int sig) deliver_thread_signal (sig, handle_arith_signal); } +#ifdef SIGDANGER + +/* Handler for SIGDANGER. */ +static void +handle_danger_signal (int sig) +{ + malloc_warning ("Operating system warns that virtual memory is running low.\n"); + + /* It might be unsafe to call do_auto_save now. */ + force_auto_save_soon (); +} + +static void +deliver_danger_signal (int sig) +{ + deliver_process_signal (sig, handle_danger_signal); +} +#endif + /* Treat SIG as a terminating signal, unless it is already ignored and we are in --batch mode. Among other things, this makes nohup work. */ static void -- 2.39.2