Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 1998 08:24:58 +0100
From:      Martin Cracauer <cracauer@cons.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        cracauer@cons.org, cvs-commiters@FreeBSD.ORG
Subject:   Re: Please review fix for /bin/sh SIGQUIT/SIGINT problem
Message-ID:  <19980206082458.10855@cons.org>
In-Reply-To: <199802052234.JAA25791@godzilla.zeta.org.au>; from Bruce Evans on Fri, Feb 06, 1998 at 09:34:39AM %2B1100
References:  <199802052234.JAA25791@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
In <199802052234.JAA25791@godzilla.zeta.org.au>, Bruce Evans wrote: 
> >This diff fixes interactive shells in the case of background jobs. Any
> >more special case?
> 
> I don't think this is right.  

I didn't mean I fixed sh's behaviour. What I meant was that my first
fix version accidentially messed with interactive behaviour and that I
changed the fix to keep this intact.

> Your fix makes the nesting of the signal handling hard to follow and
> not obviously correct.  

I agree that I obfuscate signal handling even more. But the original
sh code ignores so many important cases that I felt inserting my own
flow of signal handling to correct some obmissions is appropriate.

> forkshell() leaves signals "off" and depends
> on waitforjob() to turn them "on" again by restoring the signal state.
> There are other calls to waitforjob()...

Yes, but my fix changes behaviour only for foreground processes. I
think in the foreground process case I can assume that the next
waitforjob() call is the one that belongs to the forkshell()
call. waitforjob() restores my saved signals only when my code changed
them before.

I did some more testing of my solution (job control with
SIGINT/SOGQUIT - catching processes, some more test with subshells)
and it still seems to be solid.

Martin
-- 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer
  cracauer@wavehh.hanse.de (batched, preferred for large mails)
  Tel.: (daytime) +4940 41478712 Fax.: (daytime) +4940 41478715
  Tel.: (private) +4940 5221829 Fax.: (private) +4940 5228536
  Paper: (private) Waldstrasse 200, 22846 Norderstedt, Germany



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980206082458.10855>