From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,a863bbdada183d99,start X-Google-Attributes: gid10d4db,public X-Google-ArrivalTime: 1993-05-02 01:02:30 PST Path: gmd.de!Germany.EU.net!mcsun!news.funet.fi!hydra!hydra!not-for-mail From: jrs@world.std.com (Rick Sladkey) Newsgroups: comp.os.linux.announce Subject: bug fix for bash-1.12 available Followup-To: comp.os.linux Date: 2 May 1993 10:53:36 +0300 Organization: The Internet Sender: wirzeniu@cs.Helsinki.FI Message-ID: <1rvum0INNoma@hydra.Helsinki.FI> NNTP-Posting-Host: hydra.helsinki.fi Summary: bug fixed where two programs can fight for input when SHELL is bash Keywords: bash, non-interactive, bug-fix I have uploaded a fixed version of bash-1.12 for Linux to sunsite.unc.edu. The file for now is: * sunsite.unc.edu:/pub/Linux/Incoming/bash-1.12-fixed.tar.z This gzipped file contains Linux patches against bash-1.12 and a static binary for Linux. This distribution fixes the oft cited bug where shelling out to an editor (emacs, elvis, vile) from any program followed by an interrupt character causes both programs to fight for input. We get several messages per week on comp.os.linux asking if this is a kernel bug. It is not a kernel bug. In fact, it is due to a buglet in bash that causes bash to die when it is run non-interactively as the parent of a program that catches SIGINT without exiting. For example, if you shell out to emacs from, say, elm or trn, and type `^G' all hell breaks loose and you have to kill both programs. Since bash is my favorite shell, and since this is very disabling bug for those who frequently run into it, and since we get so many bug reports on c.o.l, I decided to take a stab at fixing it. I do not promise my fix is elegant, complete, or even correct. But it does work around this most common problem, seemingly without breaking anything else. This fix also works for other platforms than Linux where bash also shows this bug. Until bash-1.13 comes along (which corrects this problem) this may have to do. The fix is quite simple and is appended here. Rick Sladkey ----- *** orig/bash-1.12/jobs.c Fri Jan 17 16:36:11 1992 --- bash-1.12/jobs.c Sat May 1 15:00:03 1993 *************** *** 1251,1256 **** --- 1253,1263 ---- sigset_t set; sigemptyset (&set); + if (!interactive) + { + sigaddset(&set, SIGINT); + sigaddset(&set, SIGQUIT); + } sigsuspend (&set); #else /* SCO Unix */ struct sigaction act, oact;