Merge from 0.6.5

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6040 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2000-02-19 00:40:47 +00:00
parent 5276d1b6c2
commit fb65f2b8b6
36 changed files with 1074 additions and 479 deletions

View file

@ -67,31 +67,47 @@ static NSMapTable *activeTasks = 0;
@implementation NSTask
static BOOL hadChildSignal = NO;
static void handleSignal(int sig)
{
int result;
int status;
hadChildSignal = YES;
}
do
BOOL
GSCheckTasks()
{
BOOL found = NO;
if (hadChildSignal)
{
result = waitpid(-1, &status, WNOHANG);
if (result > 0)
{
if (WIFEXITED(status))
{
NSTask *t;
int result;
int status;
[tasksLock lock];
t = (NSTask*)NSMapGet(activeTasks, (void*)result);
[tasksLock unlock];
if (t)
{
[t _terminatedChild: WEXITSTATUS(status)];
}
}
}
hadChildSignal = NO;
do
{
result = waitpid(-1, &status, WNOHANG);
if (result > 0)
{
if (WIFEXITED(status))
{
NSTask *t;
[tasksLock lock];
t = (NSTask*)NSMapGet(activeTasks, (void*)result);
[tasksLock unlock];
if (t)
{
[t _terminatedChild: WEXITSTATUS(status)];
found = YES;
}
}
}
}
while (result > 0);
}
while (result > 0);
return found;
}
+ (void) initialize