Article View: comp.bugs.4bsd
Article #1359C shell "onintr" doesn't re-enable SIGINT after "onintr -".
From: Michael "Ford" Ditto
Date: Wed, 22 Mar 1989 07:09
Date: Wed, 22 Mar 1989 07:09
54 lines
2000 bytes
2000 bytes
Observed-in:
4.3BSD (Tahoe), and Ultrix V2.2
Description:
C shell "onintr" doesn't re-enable SIGINT after "onintr -".
Repeat-by:
Put the following lines in ~/.login (or just source them):
echo starting...
onintr - # temporarily disable interrupts
sleep 5 # this is non-interruptible
onintr # (supposed to) re-enable interrupts
echo done
After the above file has been sourced, the interrupt character
is ignored.
My Fix:
Patches to 4.3BSD Tahoe source:
sh.func.c 5.5 (Berkeley) 5/19/88
*** ORIGsh.func.c Wed Mar 22 01:10:35 1989
--- sh.func.c Wed Mar 22 01:26:41 1989
***************
*** 92,100
bferr("Can't from terminal");
cp = gointr, gointr = 0, xfree(cp);
if (vv == 0) {
! if (setintr)
! (void) sigblock(sigmask(SIGINT));
! else
(void) signal(SIGINT, SIG_DFL);
gointr = 0;
} else if (eq((vv = strip(vv)), "-")) {
--- 92,101 -----
bferr("Can't from terminal");
cp = gointr, gointr = 0, xfree(cp);
if (vv == 0) {
! if (setintr) {
! (void) sigblock(sigmask(SIGINT));
! (void) signal(SIGINT, pintr);
! } else
(void) signal(SIGINT, SIG_DFL);
gointr = 0;
} else if (eq((vv = strip(vv)), "-")) {
--
-=] Ford [=-
"The number of Unix installations (In Real Life: Mike Ditto)
has grown to 10, with more expected." ford@kenobi.commodore.com
- The Unix Programmer's Manual, ...!sdcsvax!crash!kenobi!ford
2nd Edition, June, 1972. ditto@cbmvax.commodore.com
Technical Details
Message-ID:
<6373@cbmvax.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!bpa!cbmvax!dittoShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!rutgers!bpa!cbmvax!ditto From: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Newsgroups: comp.bugs.4bsd Subject: C shell "onintr" doesn't re-enable SIGINT after "onintr -". Summary: Add signal(SIGINT, pintr); to doonintr(); Keywords: csh onintr SIGINT SIG_IGN Message-ID: <6373@cbmvax.UUCP> Date: 22 Mar 89 07:09:00 GMT Reply-To: ditto@cbmvax.UUCP (Michael "Ford" Ditto) Organization: Commodore Technology, West Chester, PA Lines: 54