mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Kill child when wait fails, so I_Error exits both
This commit is contained in:
parent
11910e844c
commit
648f5221c7
1 changed files with 6 additions and 1 deletions
|
|
@ -2169,9 +2169,13 @@ void I_Sleep(void)
|
||||||
#ifdef NEWSIGNALHANDLER
|
#ifdef NEWSIGNALHANDLER
|
||||||
static void I_Fork(void)
|
static void I_Fork(void)
|
||||||
{
|
{
|
||||||
|
int child;
|
||||||
int status;
|
int status;
|
||||||
int signum;
|
int signum;
|
||||||
switch (fork())
|
|
||||||
|
child = fork();
|
||||||
|
|
||||||
|
switch (child)
|
||||||
{
|
{
|
||||||
case -1:
|
case -1:
|
||||||
I_Error(
|
I_Error(
|
||||||
|
|
@ -2184,6 +2188,7 @@ static void I_Fork(void)
|
||||||
default:
|
default:
|
||||||
if (wait(&status) == -1)
|
if (wait(&status) == -1)
|
||||||
{
|
{
|
||||||
|
kill(child, SIGKILL);
|
||||||
I_Error(
|
I_Error(
|
||||||
"Error setting up signal reporting: fork(): %s\n",
|
"Error setting up signal reporting: fork(): %s\n",
|
||||||
strerror(errno)
|
strerror(errno)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue