Mercurial > emacs
comparison src/emacs.c @ 3273:a5e5e1e04331
Don't include termios.h directly--let systty.h do it.
(shut_down_emacs): Maybe close X connection here. New arg NO_X.
(Fkill_emacs): Don't close it here. Pass new arg.
(fatal_error_signal): Pass new arg.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sat, 29 May 1993 20:57:33 +0000 |
parents | 0790b5563a66 |
children | 8995a815f92f |
comparison
equal
deleted
inserted
replaced
3272:d1a31cee8fca | 3273:a5e5e1e04331 |
---|---|
31 #include <ssdef.h> | 31 #include <ssdef.h> |
32 #endif | 32 #endif |
33 | 33 |
34 #ifdef BSD | 34 #ifdef BSD |
35 #include <sys/ioctl.h> | 35 #include <sys/ioctl.h> |
36 #endif | |
37 | |
38 #ifdef HAVE_TERMIOS | |
39 #include <termios.h> | |
40 #endif | 36 #endif |
41 | 37 |
42 #ifdef APOLLO | 38 #ifdef APOLLO |
43 #ifndef APOLLO_SR10 | 39 #ifndef APOLLO_SR10 |
44 #include <default_acl.h> | 40 #include <default_acl.h> |
132 /* If fatal error occurs in code below, avoid infinite recursion. */ | 128 /* If fatal error occurs in code below, avoid infinite recursion. */ |
133 if (! fatal_error_in_progress) | 129 if (! fatal_error_in_progress) |
134 { | 130 { |
135 fatal_error_in_progress = 1; | 131 fatal_error_in_progress = 1; |
136 | 132 |
137 shut_down_emacs (sig); | 133 shut_down_emacs (sig, 0); |
138 } | 134 } |
139 | 135 |
140 #ifdef VMS | 136 #ifdef VMS |
141 LIB$STOP (SS$_ABORT); | 137 LIB$STOP (SS$_ABORT); |
142 #else | 138 #else |
636 arg = Qt; | 632 arg = Qt; |
637 | 633 |
638 if (!NILP (Vrun_hooks) && !noninteractive) | 634 if (!NILP (Vrun_hooks) && !noninteractive) |
639 call1 (Vrun_hooks, intern ("kill-emacs-hook")); | 635 call1 (Vrun_hooks, intern ("kill-emacs-hook")); |
640 | 636 |
641 #ifdef HAVE_X_WINDOWS | |
642 if (!noninteractive && EQ (Vwindow_system, intern ("x"))) | |
643 Fx_close_current_connection (); | |
644 #endif /* HAVE_X_WINDOWS */ | |
645 | |
646 UNGCPRO; | 637 UNGCPRO; |
647 | 638 |
648 /* Is it really necessary to do this deassign | 639 /* Is it really necessary to do this deassign |
649 when we are going to exit anyway? */ | 640 when we are going to exit anyway? */ |
650 /* #ifdef VMS | 641 /* #ifdef VMS |
651 stop_vms_input (); | 642 stop_vms_input (); |
652 #endif */ | 643 #endif */ |
653 stuff_buffered_input (arg); | 644 stuff_buffered_input (arg); |
654 | 645 |
655 shut_down_emacs (0); | 646 shut_down_emacs (0, 0); |
656 | 647 |
657 exit ((XTYPE (arg) == Lisp_Int) ? XINT (arg) | 648 exit ((XTYPE (arg) == Lisp_Int) ? XINT (arg) |
658 #ifdef VMS | 649 #ifdef VMS |
659 : 1 | 650 : 1 |
660 #else | 651 #else |
674 If SIG is a signal number, print a message for it. | 665 If SIG is a signal number, print a message for it. |
675 | 666 |
676 This is called by fatal signal handlers, X protocol error handlers, | 667 This is called by fatal signal handlers, X protocol error handlers, |
677 and Fkill_emacs. */ | 668 and Fkill_emacs. */ |
678 void | 669 void |
679 shut_down_emacs (sig) | 670 shut_down_emacs (sig, no_x) |
680 int sig; | 671 int sig, no_x; |
681 { | 672 { |
682 /* If we are controlling the terminal, reset terminal modes */ | 673 /* If we are controlling the terminal, reset terminal modes */ |
683 #ifdef EMACS_HAVE_TTY_PGRP | 674 #ifdef EMACS_HAVE_TTY_PGRP |
684 { | 675 { |
685 int tpgrp; | 676 int tpgrp; |
706 | 697 |
707 #ifdef VMS | 698 #ifdef VMS |
708 kill_vms_processes (); | 699 kill_vms_processes (); |
709 #endif | 700 #endif |
710 | 701 |
702 #ifdef HAVE_X_WINDOWS | |
703 if (!noninteractive && EQ (Vwindow_system, intern ("x")) && ! no_x) | |
704 Fx_close_current_connection (); | |
705 #endif /* HAVE_X_WINDOWS */ | |
706 | |
711 #ifdef SIGIO | 707 #ifdef SIGIO |
712 /* There is a tendency for a SIGIO signal to arrive within exit, | 708 /* There is a tendency for a SIGIO signal to arrive within exit, |
713 and cause a SIGHUP because the input descriptor is already closed. */ | 709 and cause a SIGHUP because the input descriptor is already closed. */ |
714 unrequest_sigio (); | 710 unrequest_sigio (); |
715 signal (SIGIO, SIG_IGN); | 711 signal (SIGIO, SIG_IGN); |