Kill child when wait fails, so I_Error exits both

This commit is contained in:
James R committed 2019-12-16 19:27:54 -08:00
1 parent c9830e5ab1
commit a64dbe1016
1 file changed
+6 -1
+6 -1
View File
@@ -3052,9 +3052,13 @@ void I_Sleep(void)
#ifdef NEWSIGNALHANDLER
static void I_Fork(void)
{
int child;
int status;
int signum;
switch (fork())
child = fork();
switch (child)
{
case -1:
I_Error(
@@ -3067,6 +3071,7 @@ static void I_Fork(void)
default:
if (wait(&status) == -1)
{
kill(child, SIGKILL);
I_Error(
"Error setting up signal reporting: fork(): %s\n",
strerror(errno)