[comp.os.minix] Problems with SIGINT...

dtynan@sultra.UUCP (Der Tynan) (10/18/88)

First off, thanks to everyone who responded to my query about the SIGINT
problem.  As a recap, basically, when you run 'make' in the background, if
you type DEL (or whatever your SIGINT character is), the 'make' will abort.
In particular, thanks to Robert Regn, for having the right answer!!

The problem lies in cc.c, in the setting of the signal traps.  Basically,
cc.c executes the following;
	signal(SIGHUP, trapcc);
	signal(SIGINT, trapcc);
	signal(SIGQUIT, trapcc);

which is not a good idea.  If the shell has set these signals to SIG_IGN (or
ignore), then the compiler removes this.  The cure is simple.  In cc.c, change
the lines to read;
	if (signal(SIGHUP, SIG_IGN) != SIG_IGN)
		signal(SIGHUP, trapcc);
	if (signal(SIGINT, SIG_IGN) != SIG_IGN)
		signal(SIGINT, trapcc);
	if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
		signal(SIGQUIT, trapcc);

This works just fine.  Of course, you *may* not want to do this for all the
signals specified, as it's only SIGINT that causes a problem, but this is
up to you.  Thanks again.
						- Der
-- 
Reply:	dtynan@sultra.UUCP		(Der Tynan @ Tynan Computers)
	{mips,pyramid}!sultra!dtynan
	Cast a cold eye on life, on death.  Horseman, pass by...    [WBY]