mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
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:
parent
ab320f7bb0
commit
ba7813d67b
2 changed files with 32 additions and 0 deletions
|
@ -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.
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue