ltlcheck: use kill instead of killpg

kill(-x,y) is more portable than killpg(x,y)

* src/bin/ltlcheck.cc: Use kill.
This commit is contained in:
Alexandre Duret-Lutz 2012-10-14 09:12:06 +02:00
parent a62a04670c
commit e46ae2799f

View file

@ -269,7 +269,7 @@ sig_handler(int sig)
if (--alarm_on)
{
// Send SIGTERM to children.
killpg(child_pid, SIGTERM);
kill(-child_pid, SIGTERM);
// Try again later if it didn't work. (alarm() will be reset
// if it did work and the call to wait() returns)
alarm(2);
@ -277,13 +277,13 @@ sig_handler(int sig)
else
{
// After a few gentle tries, really kill that child.
killpg(child_pid, SIGKILL);
kill(-child_pid, SIGKILL);
}
}
else
{
// forward signal
killpg(child_pid, sig);
kill(-child_pid, sig);
signal_received = sig;
}
}