aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJim Blandy1992-01-16 03:44:18 +0000
committerJim Blandy1992-01-16 03:44:18 +0000
commit2447c62607b87395dfec76b038dc2cb6238603b5 (patch)
tree15effdcf9daa365e1415fee06b8778f038315082 /src
parent141e63d5bad72efbc3e1e1f9436561953431d340 (diff)
downloademacs-2447c62607b87395dfec76b038dc2cb6238603b5.tar.gz
emacs-2447c62607b87395dfec76b038dc2cb6238603b5.zip
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c53
1 files changed, 29 insertions, 24 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 6e36b42f028..d615e7fdf14 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -39,13 +39,16 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
39#include <sys/ioctl.h> 39#include <sys/ioctl.h>
40#endif 40#endif
41 41
42#ifdef HAVE_TERMIOS
43#include <termios.h>
44#endif
45
42#ifdef APOLLO 46#ifdef APOLLO
43#ifndef APOLLO_SR10 47#ifndef APOLLO_SR10
44#include <default_acl.h> 48#include <default_acl.h>
45#endif 49#endif
46#endif 50#endif
47 51
48#undef NULL
49#include "lisp.h" 52#include "lisp.h"
50#include "commands.h" 53#include "commands.h"
51 54
@@ -107,13 +110,10 @@ int fatal_error_code;
107int fatal_error_in_progress; 110int fatal_error_in_progress;
108 111
109/* Handle bus errors, illegal instruction, etc. */ 112/* Handle bus errors, illegal instruction, etc. */
113SIGTYPE
110fatal_error_signal (sig) 114fatal_error_signal (sig)
111 int sig; 115 int sig;
112{ 116{
113#ifdef BSD
114 int tpgrp;
115#endif /* BSD */
116
117 fatal_error_code = sig; 117 fatal_error_code = sig;
118 signal (sig, SIG_DFL); 118 signal (sig, SIG_DFL);
119 119
@@ -124,15 +124,23 @@ fatal_error_signal (sig)
124 fatal_error_in_progress = 1; 124 fatal_error_in_progress = 1;
125 125
126 /* If we are controlling the terminal, reset terminal modes */ 126 /* If we are controlling the terminal, reset terminal modes */
127#ifdef BSD 127#if defined(TIOCGPGRP) || defined(HAVE_TERMIOS)
128 if (ioctl(0, TIOCGPGRP, &tpgrp) == 0 128 {
129 && tpgrp == getpgrp (0)) 129 int tpgrp;
130#endif /* BSD */ 130 if (
131 { 131#ifdef HAVE_TERMIOS
132 reset_sys_modes (); 132 (tpgrp = tcgetpgrp (0)) != -1
133 if (sig != SIGTERM) 133#else
134 fprintf (stderr, "Fatal error (%d).", sig); 134 ioctl(0, TIOCGPGRP, &tpgrp) == 0
135 } 135#endif
136 && tpgrp == getpgrp (0))
137 {
138 reset_sys_modes ();
139 if (sig != SIGTERM)
140 fprintf (stderr, "Fatal error (%d).", sig);
141 }
142 }
143#endif /* uses pgrp */
136 144
137 /* Clean up */ 145 /* Clean up */
138#ifdef subprocesses 146#ifdef subprocesses
@@ -410,9 +418,6 @@ main (argc, argv, envp)
410 } 418 }
411 419
412 init_alloc (); 420 init_alloc ();
413#ifdef MAINTAIN_ENVIRONMENT
414 init_environ ();
415#endif
416 init_eval (); 421 init_eval ();
417 init_data (); 422 init_data ();
418 init_lread (); 423 init_lread ();
@@ -454,9 +459,6 @@ main (argc, argv, envp)
454 for the sake of symbols like error-message */ 459 for the sake of symbols like error-message */
455 syms_of_data (); 460 syms_of_data ();
456 syms_of_alloc (); 461 syms_of_alloc ();
457#ifdef MAINTAIN_ENVIRONMENT
458 syms_of_environ ();
459#endif /* MAINTAIN_ENVIRONMENT */
460 syms_of_lread (); 462 syms_of_lread ();
461 syms_of_print (); 463 syms_of_print ();
462 syms_of_eval (); 464 syms_of_eval ();
@@ -574,7 +576,7 @@ all of which are called before Emacs is actually killed.")
574 if (feof (stdin)) 576 if (feof (stdin))
575 arg = Qt; 577 arg = Qt;
576 578
577 if (!NULL (Vrun_hooks) && !noninteractive) 579 if (!NILP (Vrun_hooks) && !noninteractive)
578 call1 (Vrun_hooks, intern ("kill-emacs-hook")); 580 call1 (Vrun_hooks, intern ("kill-emacs-hook"));
579 581
580#ifdef subprocesses 582#ifdef subprocesses
@@ -677,7 +679,7 @@ and announce itself normally when it is run.")
677 679
678 CHECK_STRING (intoname, 0); 680 CHECK_STRING (intoname, 0);
679 intoname = Fexpand_file_name (intoname, Qnil); 681 intoname = Fexpand_file_name (intoname, Qnil);
680 if (!NULL (symname)) 682 if (!NILP (symname))
681 { 683 {
682 CHECK_STRING (symname, 0); 684 CHECK_STRING (symname, 0);
683 if (XSTRING (symname)->size) 685 if (XSTRING (symname)->size)
@@ -697,7 +699,7 @@ and announce itself normally when it is run.")
697 malloc_init (&my_edata, malloc_warning); 699 malloc_init (&my_edata, malloc_warning);
698#endif 700#endif
699 unexec (XSTRING (intoname)->data, 701 unexec (XSTRING (intoname)->data,
700 !NULL (symname) ? XSTRING (symname)->data : 0, &my_edata, 0, 0); 702 !NILP (symname) ? XSTRING (symname)->data : 0, &my_edata, 0, 0);
701#endif /* not VMS */ 703#endif /* not VMS */
702 704
703 Vpurify_flag = tem; 705 Vpurify_flag = tem;
@@ -724,7 +726,10 @@ decode_env_path (evarname, defalt)
724 726
725 Lisp_Object lpath; 727 Lisp_Object lpath;
726 728
727 path = (char *) egetenv (evarname); 729 /* It's okay to use getenv here, because this function is only used
730 to initialize variables when Emacs starts up, and isn't called
731 after that. */
732 path = (char *) getenv (evarname);
728 if (!path) 733 if (!path)
729 path = defalt; 734 path = defalt;
730 lpath = Qnil; 735 lpath = Qnil;