chip@tct.uucp (Chip Salzenberg) (02/08/91)
In addition to the patches I posted two days ago, these patches for Emacs 18.56 make it work properly under SCO UNIX 3.2v2 with job control. This further patch fixes a bug that causes Emacs to suspend itself when attempting to flush the output of a dead or dying child running through a pseudo-tty. In the process of nailing that bug to the wall, I think I finished the conversion of Emacs always to use POSIX job control if on a POSIX system, instead of the BSD ioctl() calls. I would like it noted that, to my knowledge, Emacs 18.56 works well under SCO UNIX without my patches IF you do not use job control and IF you be sure that the job control-related macros from <termio.h> and <signal.h> are not defined in the Emacs code that tests for their presence. But if you're going to modify Emacs to undefine TIOCGPGRP and SIGTSTP and all those, you might as well use my patches and get job control in the bargain. :-) #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh <file", e.g.. If this archive is complete, you # will see the following message at the end: # "End of shell archive." # Contents: emacs.pat2-sco # Wrapped by chip@tct on Fri Feb 8 09:48:39 1991 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'emacs.pat2-sco' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'emacs.pat2-sco'\" else echo shar: Extracting \"'emacs.pat2-sco'\" \(3085 characters\) sed "s/^X//" >'emacs.pat2-sco' <<'END_OF_FILE' X X*** P1/emacs.c Wed Feb 6 11:27:04 1991 X--- emacs.c Thu Feb 7 11:44:05 1991 X*************** X*** 43,46 **** X--- 43,50 ---- X #endif X X+ #ifdef HAVE_TERMIOS X+ #include <termios.h> X+ #endif X+ X #ifdef APOLLO X #ifndef APOLLO_SR10 X*************** X*** 109,116 **** X int sig; X { X- #ifdef BSD X- int tpgrp; X- #endif /* BSD */ X- X fatal_error_code = sig; X signal (sig, SIG_DFL); X--- 113,116 ---- X*************** X*** 123,135 **** X X /* If we are controlling the terminal, reset terminal modes */ X! #ifdef BSD X! if (ioctl(0, TIOCGPGRP, &tpgrp) == 0 X && tpgrp == getpgrp (0)) X! #endif /* BSD */ X! { X! reset_sys_modes (); X! if (sig != SIGTERM) X! fprintf (stderr, "Fatal error (%d).", sig); X! } X X /* Clean up */ X--- 123,143 ---- X X /* If we are controlling the terminal, reset terminal modes */ X! #if defined(TIOCGPGRP) || defined(HAVE_TERMIOS) X! { X! int tpgrp; X! if ( X! #ifdef HAVE_TERMIOS X! (tpgrp = tcgetpgrp (0)) != -1 X! #else X! ioctl(0, TIOCGPGRP, &tpgrp) == 0 X! #endif X && tpgrp == getpgrp (0)) X! { X! reset_sys_modes (); X! if (sig != SIGTERM) X! fprintf (stderr, "Fatal error (%d).", sig); X! } X! } X! #endif /* uses pgrp */ X X /* Clean up */ X X*** P1/process.c Wed Feb 6 11:46:28 1991 X--- process.c Thu Feb 7 11:52:45 1991 X*************** X*** 46,50 **** X--- 46,54 ---- X #endif /* BSD or STRIDE */ X #ifdef USG X+ #ifdef HAVE_TERMIOS X+ #include <termios.h> X+ #else X #include <termio.h> X+ #endif X #include <fcntl.h> X #endif /* USG */ X*************** X*** 2006,2022 **** X current_group = Qnil; X X! #ifdef TIOCGPGRP /* Not sure about this! (fnf) */ X /* If we are using pgrps, get a pgrp number and make it negative. */ X if (!NULL (current_group)) X { X! ioctl (XFASTINT (p->infd), TIOCGPGRP, &gid); X! gid = - gid; X } X- else X- gid = - XFASTINT (p->pid); X- #else /* not using pgrps */ X- /* Can't select pgrps on this system, so we know that X- the child itself heads the pgrp. */ X- gid = - XFASTINT (p->pid); X #endif /* not using pgrps */ X X--- 2010,2030 ---- X current_group = Qnil; X X! /* Assume that we can't select pgrps on this system, X! so the child itself heads the pgrp. */ X! gid = - XFASTINT (p->pid); X! X! #if defined(TIOCGPGRP) || defined(HAVE_TERMIOS) X /* If we are using pgrps, get a pgrp number and make it negative. */ X if (!NULL (current_group)) X { X! int i; X! #ifdef HAVE_TERMIOS X! if ((i = tcgetpgrp (XFASTINT (p->infd))) != -1) X! gid = -i; X! #else X! if (ioctl (XFASTINT (p->infd), TIOCGPGRP, &i) == 0) X! gid = -i; X! #endif X } X #endif /* not using pgrps */ X X X*** P1/sysdep.c Wed Feb 6 11:34:32 1991 X--- sysdep.c Thu Feb 7 11:58:07 1991 X*************** X*** 458,462 **** X { X #ifdef HAVE_TERMIOS X! tcflush (channel, TCOFLUSH); X #else X #ifdef TCFLSH X--- 458,464 ---- X { X #ifdef HAVE_TERMIOS X! /* If we try this, we get hit with SIGTTIN, because X! the child's tty belongs to the child's pgrp. */ X! /* tcflush (channel, TCOFLUSH); */ X #else X #ifdef TCFLSH END_OF_FILE if test 3085 -ne `wc -c <'emacs.pat2-sco'`; then echo shar: \"'emacs.pat2-sco'\" unpacked with wrong size! fi # end of 'emacs.pat2-sco' fi echo shar: End of shell archive. exit 0