Bugfixes for report by stark@easynet.fr

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3526 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-01-05 21:20:33 +00:00
parent 8bae88cfe4
commit bbd3a6343e
3 changed files with 37 additions and 20 deletions

View file

@ -67,6 +67,7 @@ static void handleSignal(int sig)
if (WIFEXITED(status))
{
NSTask *t;
[tasksLock lock];
t = (NSTask*)NSMapGet(activeTasks, (void*)result);
[tasksLock unlock];
@ -93,7 +94,7 @@ static void handleSignal(int sig)
}
[gnustep_global_lock unlock];
signal(SIGCHLD, SIG_IGN);
signal(SIGCHLD, handleSignal);
}
}
@ -507,11 +508,6 @@ static void handleSignal(int sig)
#else
kill(-taskId, SIGTERM);
#endif
if (hasNotified == NO)
{
[self _sendNotification];
}
}
- (void) waitUntilExit

View file

@ -898,19 +898,37 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
[NSException raise: NSFileHandleOperationException
format: @"attempt to close closed file"];
[self ignoreReadDescriptor];
[self ignoreWriteDescriptor];
[readInfo release];
readInfo = nil;
[writeInfo removeAllObjects];
(void)close(descriptor);
descriptor = -1;
acceptOK = NO;
connectOK = NO;
readOK = NO;
writeOK = NO;
/*
* Clear any pending operations on the file handle, sending
* notifications if necessary.
*/
if (readInfo)
{
[readInfo setObject: @"File handle closed locally"
forKey: GSFileHandleNotificationError];
[self postReadNotification];
}
else
[self ignoreReadDescriptor];
if ([writeInfo count])
{
NSMutableDictionary *info = [writeInfo objectAtIndex: 0];
[info setObject: @"File handle closed locally"
forKey: GSFileHandleNotificationError];
[self postWriteNotification];
[writeInfo removeAllObjects];
}
else
[self ignoreWriteDescriptor];
}
- (void)synchronizeFile
@ -991,7 +1009,8 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin)
postingStyle: NSPostASAP
coalesceMask: NSNotificationNoCoalescing
forModes: modes];
[self watchWriteDescriptor]; /* In case of queued writes. */
if ((writeOK || connectOK) && [writeInfo count] > 0)
[self watchWriteDescriptor]; /* In case of queued writes. */
}
- (BOOL)readInProgress