Fix for tasks exiting on signal.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9552 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2001-04-10 05:22:12 +00:00
parent ab320f7bb0
commit ba7813d67b
2 changed files with 32 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2001-04-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTask.m: Bugfix to send out task termination notification
and clean up correctly when a task is killed by a signal rather than
exiting cleanly.
2001-04-09 Adam Fedor <fedor@gnu.org>
* 1.0 branch merged into main.

View file

@ -806,6 +806,24 @@ GSCheckTasks()
found = YES;
}
}
else if (WIFSIGNALED(status))
{
NSTask *t;
[tasksLock lock];
t = (NSTask*)NSMapGet(activeTasks, (void*)result);
[tasksLock unlock];
if (t)
{
[t _terminatedChild: WTERMSIG(status)];
found = YES;
}
}
else
{
NSLog(@"Warning ... task %d neither exited nor signalled",
result);
}
}
}
while (result > 0);
@ -1055,6 +1073,14 @@ GSCheckTasks()
#endif
[self _terminatedChild: WEXITSTATUS(_terminationStatus)];
}
else if (WIFSIGNALED(_terminationStatus))
{
#ifdef WAITDEBUG
NSLog(@"waitpid %d, termination status = %d",
_taskId, _terminationStatus);
#endif
[self _terminatedChild: WTERMSIG(_terminationStatus)];
}
#ifdef WAITDEBUG
else
NSLog(@"waitpid %d, event status = %d",