[comp.unix.xenix.sco] Patch 2/3 for bash on Xenix

bhepple@Asia.Sun.Com (Bob Hepple - Sun Asia Mktg) (04/24/91)

Hmm - part 2 didn't make it. Let's try again ...

------------------------------------------------------------------
This is the second file for bash. This is a fix to a signal
handling problem I had running emacs (bug report -> running emacs from
bash. First time you do a ^G, emacs catches it and does a
keyboard-quit, ie cancels current operation. Second time, bash catches
it and kills emacs. Nice!) I think you might want this too ...

From: chet@ODIN.INS.CWRU.EDU (Chet Ramey)
Newsgroups: gnu.bash.bug
Subject: Re: bash and emacs under SCO unix: ^G disconnect
Message-ID: <1991Apr2.204541.14382@usenet.ins.cwru.edu>
Date: 2 Apr 91 20:45:41 GMT
References: <9103312019.AA18323@life.ai.mit.edu>
Reply-To: chet@po.cwru.edu
Distribution: gnu
Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA)
Lines: 38

In article <9103312019.AA18323@life.ai.mit.edu> tranle@intellicorp.com writes:
>I am using both bash-1.05 and emacs-18.57 under SCO unix and I seem
>to have problem with ^G under emacs.
>
>When I am connected across the net (tcpip) and running emacs, the first
>^G under emacs seems to be caught correctly by emacs but the 2nd ^G seems 
>to be sent to bash and I get disconnected.

Replace the existing definition of sigint_sighandler () in shell.c with
this code, and make sure USG is defined:

/* What we really do when SIGINT occurs. */
sighandler
sigint_sighandler (sig)
     int sig;
{
#if defined (USG) && !defined (_POSIX_VERSION)
  signal (sig, sigint_sighandler);
#endif

  /* interrupt_state needs to be set for the stack of interrupts to work
     right.  Should it be set unconditionally? */
  if (!interrupt_state)
    interrupt_state++;
  if (interrupt_immediately)
    {
      interrupt_immediately = 0;
      throw_to_top_level ();
    }
#ifdef ibm032
  return (0);   /* To shut up the compiler */
#endif
}
-- 
Chet Ramey				``Now, somehow we've brought our sins
Network Services Group			  back physically -- and they're
Case Western Reserve University		  pissed.''
chet@ins.CWRU.Edu		My opinions are just those, and mine alone.