summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1996-01-09 23:38:34 +0000
committerKarl Heuer <kwzh@gnu.org>1996-01-09 23:38:34 +0000
commit0b311c376cc7c895e1704b979f64fa3b396e95c6 (patch)
treef2a29385c4ad4a1f8099ec198f57eebd0772b45b /src
parent2284bd5cb23e70a57b9fd740b458cd6d4185744d (diff)
downloademacs-0b311c376cc7c895e1704b979f64fa3b396e95c6.tar.gz
(main): In batch mode, don't handle SIGHUP if was ignored.
Block it while we decide what to do.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 4f0d70cbbe1..b18e3d5dc5f 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -646,6 +646,22 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\
init_signals ();
#endif
+ /* Don't catch SIGHUP if dumping. */
+ if (1
+#ifndef CANNOT_DUMP
+ && initialized
+#endif
+ )
+ {
+ sigblockx (SIGHUP);
+ /* In --batch mode, don't catch SIGHUP if already ignored.
+ That makes nohup work. */
+ if (! noninteractive
+ || signal (SIGHUP, SIG_IGN) != SIG_IGN)
+ signal (SIGHUP, fatal_error_signal);
+ sigunblockx (SIGHUP);
+ }
+
if (
#ifndef CANNOT_DUMP
! noninteractive || initialized
@@ -654,10 +670,9 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\
#endif
)
{
- /* Don't catch these signals in batch mode if not initialized.
+ /* Don't catch these signals in batch mode if dumping.
On some machines, this sets static data that would make
signal fail to work right when the dumped Emacs is run. */
- signal (SIGHUP, fatal_error_signal);
signal (SIGQUIT, fatal_error_signal);
signal (SIGILL, fatal_error_signal);
signal (SIGTRAP, fatal_error_signal);