Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!hplabs!hplabsc!daemon From: daemon@hplabsc.UUCP Newsgroups: comp.mail.elm Subject: fix for batch mode ignoring SIGINT Message-ID: <2084@hplabsc.HP.COM> Date: Tue, 23-Jun-87 01:55:20 EDT Article-I.D.: hplabsc.2084 Posted: Tue Jun 23 01:55:20 1987 Date-Received: Wed, 24-Jun-87 06:37:01 EDT Sender: daemon@hplabsc.HP.COM Reply-To: mkhaw@teknowledge-vaxc.ARPA (Michael Khaw) Organization: Teknowledge, Inc., Palo Alto CA Lines: 27 Approved: taylor@hplabs (with 'postmail') In editmsg.c there is a setjmp()/logjmp() deal to handle SIGINT, but it fails in two ways: 1) the setjmp occurs inside a while-loop, so if you interrupt before having typed anything terminated with a newline, the SIGINT handler gets called, and it tries to longjmp() to a context that hasn't been set up yet so you get a "longjmp botch" and Elm dies. 2) longjmp() takes 2 arguments, but the SIGINT handler calls longjmp with only the jmp_buf argument, so (at least on my Ultrix system) setjmp() always returns with a 0 value and you can't ever abort by hitting interrupt. Fix: (Too little for a diff) 1) move the entire "if (setjmp ..." clause above the label "raw_input :" 2) give the call to longjmp() a second argument: a non-zero integer. Mike Khaw -- internet: mkhaw@teknowledge-vaxc.arpa usenet: {hplabs|sun|ucbvax|decwrl|sri-unix}!mkhaw%teknowledge-vaxc.arpa USnail: Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303