bmake not killing childrens
Matthew Dillon
dillon at apollo.backplane.com
Wed Oct 4 13:11:39 PDT 2006
:
:> Our normal 'make' sometimes fails to kill children too. Now it is
:> certainly possible for a program to ignore SIGINT, but the real
:> problem here is probably due to a bug in DragonFly rather than a bug
:> in make or bmake.
:
:The problem has been reported on other operating systems too. (And I have
:had the problem with NetBSD's bmake on Linux platform also.)
I looked at the code, and it doesn't look hard to fix. The problem is
this bit:
void
Compat_Run(Lst targs)
{
GNode *gn = NULL;/* Current root target */
int errors; /* Number of targets not remade due to errors */
Compat_Init();
if (signal(SIGINT, SIG_IGN) != SIG_IGN) {
signal(SIGINT, CompatInterrupt);
}
...
}
That, folks, is an example of poor coding. SIGINT is disabled for
a few microseconds while the code checks to see if it is being ignored
or not.
Instead, sigaction() should be used to poll the current state of the
signal to determine whether it is being ignored or not.
-Matt
Matthew Dillon
<dillon at xxxxxxxxxxxxx>
More information about the Users
mailing list