mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
More patches from Frith-MacDonald.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2708 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e2057d4f08
commit
49be21f6c3
3 changed files with 36 additions and 4 deletions
|
@ -1,3 +1,12 @@
|
|||
Wed Jan 21 17:37:00 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Tools/defaults.m: Fixed bug in handling 'write' operations reading
|
||||
info from stdin - now puts all values into the database correctly.
|
||||
|
||||
* src/TcpPort.m: ([+newForReceivingFromPortNumber:]) added code to
|
||||
perform retries if the kernel freaks out when asked to select the
|
||||
port to bind to - this has happened to me on linux!
|
||||
|
||||
Wed Jan 21 11:45:00 1998 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* src/GetDefEncoding.m: Modified GetDefEncoding() to us the NSString
|
||||
|
|
|
@ -752,9 +752,31 @@ static NSMapTable* port_number_2_port;
|
|||
sizeof (p->_listening_address))
|
||||
< 0)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"[TcpInPort +newForReceivingFromPortNumber:] bind(): %s",
|
||||
strerror(errno)];
|
||||
BOOL ok = NO;
|
||||
/* bind() sometimes seems to fail when given a port of zero - this
|
||||
* should really never happen, so we retry a few times in case the
|
||||
* kernel has had a temporary brainstorm.
|
||||
*/
|
||||
if (n == 0) {
|
||||
int count;
|
||||
|
||||
for (count = 0; count < 10; count++) {
|
||||
memset(&p->_listening_address, 0, sizeof(p->_listening_address));
|
||||
p->_listening_address.sin_addr.s_addr = htonl (INADDR_ANY);
|
||||
p->_listening_address.sin_family = AF_INET;
|
||||
if (bind (p->_port_socket,
|
||||
(struct sockaddr*) &(p->_listening_address),
|
||||
sizeof (p->_listening_address)) == 0) {
|
||||
ok = YES;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ok == NO) {
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"[TcpInPort +newForReceivingFromPortNumber:] bind(): %s",
|
||||
strerror(errno)];
|
||||
}
|
||||
}
|
||||
|
||||
/* If the caller didn't specify a port number, it was chosen for us.
|
||||
|
|
|
@ -427,6 +427,7 @@ property list which is set as the value of a default.\n\n");
|
|||
domain = [NSMutableDictionary dictionaryWithCapacity:1];
|
||||
}
|
||||
[domain setObject: obj forKey: name];
|
||||
[defs setPersistentDomain: domain forName: owner];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -469,8 +470,8 @@ property list which is set as the value of a default.\n\n");
|
|||
exit(0);
|
||||
}
|
||||
}
|
||||
[defs setPersistentDomain: domain forName: owner];
|
||||
}
|
||||
[defs setPersistentDomain: domain forName: owner];
|
||||
|
||||
if ([defs synchronize] == NO) {
|
||||
NSLog(@"defaults: unable to write to defaults database - %s\n",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue