*BSD News Article 47566


Return to BSD News archive

Xref: sserve comp.unix.bsd.freebsd.misc:3743 comp.unix.programmer:27365
Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.kei.com!news.mathworks.com!fu-berlin.de!cs.tu-berlin.de!fauern!news.tu-chemnitz.de!irz401!uriah.heep!bonnie.heep!not-for-mail
From: j@bonnie.heep.sax.de (J Wunsch)
Newsgroups: comp.unix.bsd.freebsd.misc,comp.unix.programmer
Subject: Re: xterm & SIGINT
Date: 21 Jul 1995 10:46:55 +0200
Organization: Private U**x site, Dresden.
Lines: 17
Message-ID: <3unphv$o6d@bonnie.tcd-dresden.de>
References: <3ulrsl$jf7@nnrp1.primenet.com>
Reply-To: joerg_wunsch@uriah.heep.sax.de
NNTP-Posting-Host: 192.109.108.139
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Jeff Rugen <jrugen@primenet.com> wrote:

>I'm writing a program that has a little command-line interface.  One 
>command will cause the program to fork() and exec an xterm, running tail 
>in the new xterm to continuously display a file that's updating.  My main 
>program can execute scripts, and I'm catching SIGINT to abort execution 
>of the script.  This works fine - when I hit ^C, the script aborts.  
>Unfortunately, the xterm running tail also gets killed.

I think the correct way is to assign the child process another process
group.  This way, it should not get the terminal driver signals
delivered.  (But caution: this will also make it ignoring hangups.)
-- 
cheers, J"org                      private:   joerg_wunsch@uriah.heep.sax.de
                                   http://www.sax.de/~joerg/

Never trust an operating system you don't have sources for. ;-)