# HG changeset patch # User Jim Blandy # Date 695533458 0 # Node ID d5b34c57b5e7f76e537850752594a926a892c49c # Parent e23ef64fac27a6e79ddf5006353dd2253d0e03dd *** empty log message *** diff -r e23ef64fac27 -r d5b34c57b5e7 src/emacs.c --- a/src/emacs.c Thu Jan 16 03:40:01 1992 +0000 +++ b/src/emacs.c Thu Jan 16 03:44:18 1992 +0000 @@ -39,13 +39,16 @@ #include #endif +#ifdef HAVE_TERMIOS +#include +#endif + #ifdef APOLLO #ifndef APOLLO_SR10 #include #endif #endif -#undef NULL #include "lisp.h" #include "commands.h" @@ -107,13 +110,10 @@ int fatal_error_in_progress; /* Handle bus errors, illegal instruction, etc. */ +SIGTYPE fatal_error_signal (sig) int sig; { -#ifdef BSD - int tpgrp; -#endif /* BSD */ - fatal_error_code = sig; signal (sig, SIG_DFL); @@ -124,15 +124,23 @@ fatal_error_in_progress = 1; /* If we are controlling the terminal, reset terminal modes */ -#ifdef BSD - if (ioctl(0, TIOCGPGRP, &tpgrp) == 0 - && tpgrp == getpgrp (0)) -#endif /* BSD */ - { - reset_sys_modes (); - if (sig != SIGTERM) - fprintf (stderr, "Fatal error (%d).", sig); - } +#if defined(TIOCGPGRP) || defined(HAVE_TERMIOS) + { + int tpgrp; + if ( +#ifdef HAVE_TERMIOS + (tpgrp = tcgetpgrp (0)) != -1 +#else + ioctl(0, TIOCGPGRP, &tpgrp) == 0 +#endif + && tpgrp == getpgrp (0)) + { + reset_sys_modes (); + if (sig != SIGTERM) + fprintf (stderr, "Fatal error (%d).", sig); + } + } +#endif /* uses pgrp */ /* Clean up */ #ifdef subprocesses @@ -410,9 +418,6 @@ } init_alloc (); -#ifdef MAINTAIN_ENVIRONMENT - init_environ (); -#endif init_eval (); init_data (); init_lread (); @@ -454,9 +459,6 @@ for the sake of symbols like error-message */ syms_of_data (); syms_of_alloc (); -#ifdef MAINTAIN_ENVIRONMENT - syms_of_environ (); -#endif /* MAINTAIN_ENVIRONMENT */ syms_of_lread (); syms_of_print (); syms_of_eval (); @@ -574,7 +576,7 @@ if (feof (stdin)) arg = Qt; - if (!NULL (Vrun_hooks) && !noninteractive) + if (!NILP (Vrun_hooks) && !noninteractive) call1 (Vrun_hooks, intern ("kill-emacs-hook")); #ifdef subprocesses @@ -677,7 +679,7 @@ CHECK_STRING (intoname, 0); intoname = Fexpand_file_name (intoname, Qnil); - if (!NULL (symname)) + if (!NILP (symname)) { CHECK_STRING (symname, 0); if (XSTRING (symname)->size) @@ -697,7 +699,7 @@ malloc_init (&my_edata, malloc_warning); #endif unexec (XSTRING (intoname)->data, - !NULL (symname) ? XSTRING (symname)->data : 0, &my_edata, 0, 0); + !NILP (symname) ? XSTRING (symname)->data : 0, &my_edata, 0, 0); #endif /* not VMS */ Vpurify_flag = tem; @@ -724,7 +726,10 @@ Lisp_Object lpath; - path = (char *) egetenv (evarname); + /* It's okay to use getenv here, because this function is only used + to initialize variables when Emacs starts up, and isn't called + after that. */ + path = (char *) getenv (evarname); if (!path) path = defalt; lpath = Qnil;