diff options
| author | Karl Heuer | 1996-01-09 23:38:34 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-01-09 23:38:34 +0000 |
| commit | 1efa2983a439ae1f5f282cd0c780bded4869881a (patch) | |
| tree | 60ae069dab4167194b7e72237e7e03bd25bd0da4 /src | |
| parent | ced1d19aebcf2bb16f7ef8d29e1a44e9d7d59cad (diff) | |
| download | emacs-1efa2983a439ae1f5f282cd0c780bded4869881a.tar.gz emacs-1efa2983a439ae1f5f282cd0c780bded4869881a.zip | |
(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.c | 19 |
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\ | |||
| 646 | init_signals (); | 646 | init_signals (); |
| 647 | #endif | 647 | #endif |
| 648 | 648 | ||
| 649 | /* Don't catch SIGHUP if dumping. */ | ||
| 650 | if (1 | ||
| 651 | #ifndef CANNOT_DUMP | ||
| 652 | && initialized | ||
| 653 | #endif | ||
| 654 | ) | ||
| 655 | { | ||
| 656 | sigblockx (SIGHUP); | ||
| 657 | /* In --batch mode, don't catch SIGHUP if already ignored. | ||
| 658 | That makes nohup work. */ | ||
| 659 | if (! noninteractive | ||
| 660 | || signal (SIGHUP, SIG_IGN) != SIG_IGN) | ||
| 661 | signal (SIGHUP, fatal_error_signal); | ||
| 662 | sigunblockx (SIGHUP); | ||
| 663 | } | ||
| 664 | |||
| 649 | if ( | 665 | if ( |
| 650 | #ifndef CANNOT_DUMP | 666 | #ifndef CANNOT_DUMP |
| 651 | ! noninteractive || initialized | 667 | ! noninteractive || initialized |
| @@ -654,10 +670,9 @@ Usage: %s [-t term] [--terminal term] [-nw] [--no-windows] [--batch]\n\ | |||
| 654 | #endif | 670 | #endif |
| 655 | ) | 671 | ) |
| 656 | { | 672 | { |
| 657 | /* Don't catch these signals in batch mode if not initialized. | 673 | /* Don't catch these signals in batch mode if dumping. |
| 658 | On some machines, this sets static data that would make | 674 | On some machines, this sets static data that would make |
| 659 | signal fail to work right when the dumped Emacs is run. */ | 675 | signal fail to work right when the dumped Emacs is run. */ |
| 660 | signal (SIGHUP, fatal_error_signal); | ||
| 661 | signal (SIGQUIT, fatal_error_signal); | 676 | signal (SIGQUIT, fatal_error_signal); |
| 662 | signal (SIGILL, fatal_error_signal); | 677 | signal (SIGILL, fatal_error_signal); |
| 663 | signal (SIGTRAP, fatal_error_signal); | 678 | signal (SIGTRAP, fatal_error_signal); |