Updates to reduce global namespace pollution. Plenty more remaining.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@23795 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2006-10-09 14:00:01 +00:00
parent 4874117588
commit 31342aef09
85 changed files with 1090 additions and 1277 deletions

View file

@ -44,6 +44,7 @@
#include "Foundation/NSFileManager.h"
#include "Foundation/NSProcessInfo.h"
#include "GSPrivate.h"
#include "GSPortPrivate.h"
#include <stdio.h>
@ -302,15 +303,15 @@ static Class runLoopClass;
e |= NBLK_OPT;
if (fcntl(d, F_SETFL, e) < 0)
{
NSLog(@"unable to set non-blocking mode on %d - %s",
d, GSLastErrorStr(errno));
NSLog(@"unable to set non-blocking mode on %d - %@",
d, [_GSPrivate error]);
return nil;
}
}
else
{
NSLog(@"unable to get non-blocking mode on %d - %s",
d, GSLastErrorStr(errno));
NSLog(@"unable to get non-blocking mode on %d - %@",
d, [_GSPrivate error]);
return nil;
}
handle = (GSMessageHandle*)NSAllocateObject(self, 0, NSDefaultMallocZone());
@ -379,9 +380,8 @@ static Class runLoopClass;
{
if (errno != EINPROGRESS)
{
NSLog(@"unable to make connection to %s - %s",
sockAddr.sun_path,
GSLastErrorStr(errno));
NSLog(@"unable to make connection to %s - %@",
sockAddr.sun_path, [_GSPrivate error]);
M_UNLOCK(myLock);
return NO;
}
@ -607,7 +607,7 @@ static Class runLoopClass;
else if (errno != EINTR && errno != EAGAIN)
{
NSDebugMLLog(@"NSMessagePort",
@"read failed - %s on 0x%x", GSLastErrorStr(errno), self);
@"read failed - %@ on 0x%p", [_GSPrivate error], self);
M_UNLOCK(myLock);
[self invalidate];
return;
@ -906,7 +906,7 @@ static Class runLoopClass;
&& res != 0)
{
state = GS_H_UNCON;
NSLog(@"connect attempt failed - %s", GSLastErrorStr(res));
NSLog(@"connect attempt failed - %@", [_GSPrivate error]);
}
else
{
@ -922,8 +922,8 @@ static Class runLoopClass;
else
{
state = GS_H_UNCON;
NSLog(@"connect write attempt failed - %s",
GSLastErrorStr(errno));
NSLog(@"connect write attempt failed - %@",
[_GSPrivate error]);
}
RELEASE(d);
}
@ -957,7 +957,7 @@ static Class runLoopClass;
{
if (errno != EINTR && errno != EAGAIN)
{
NSLog(@"write attempt failed - %s", GSLastErrorStr(errno));
NSLog(@"write attempt failed - %@", [_GSPrivate error]);
M_UNLOCK(myLock);
[self invalidate];
return;
@ -1249,7 +1249,7 @@ typedef struct {
sizeof(sockAddr.sun_path));
if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0)
{
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
desc = -1;
}
else if (bind(desc, (struct sockaddr *)&sockAddr,
@ -1263,23 +1263,23 @@ typedef struct {
close(desc);
if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0)
{
NSLog(@"unable to create socket - %s",
GSLastErrorStr(errno));
NSLog(@"unable to create socket - %@",
[_GSPrivate error]);
desc = -1;
}
else if (bind(desc, (struct sockaddr *)&sockAddr,
SUN_LEN(&sockAddr)) < 0)
{
NSLog(@"unable to bind to %s - %s",
sockAddr.sun_path, GSLastErrorStr(errno));
NSLog(@"unable to bind to %s - %@",
sockAddr.sun_path, [_GSPrivate error]);
(void) close(desc);
desc = -1;
}
}
else
{
NSLog(@"unable to bind to %s - %s",
sockAddr.sun_path, GSLastErrorStr(errno));
NSLog(@"unable to bind to %s - %@",
sockAddr.sun_path, [_GSPrivate error]);
(void) close(desc);
desc = -1;
}
@ -1291,13 +1291,13 @@ typedef struct {
}
else if (listen(desc, 128) < 0)
{
NSLog(@"unable to listen on port - %s", GSLastErrorStr(errno));
NSLog(@"unable to listen on port - %@", [_GSPrivate error]);
(void) close(desc);
DESTROY(port);
}
else if (getsockname(desc, (struct sockaddr*)&sockAddr, &i) < 0)
{
NSLog(@"unable to get socket name - %s", GSLastErrorStr(errno));
NSLog(@"unable to get socket name - %@", [_GSPrivate error]);
(void) close(desc);
DESTROY(port);
}
@ -1492,7 +1492,7 @@ typedef struct {
sock = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC);
if (sock < 0)
{
NSLog(@"unable to create socket - %s", GSLastErrorStr(errno));
NSLog(@"unable to create socket - %@", [_GSPrivate error]);
}
#ifndef BROKEN_SO_REUSEADDR
/*
@ -1505,13 +1505,13 @@ typedef struct {
sizeof(opt)) < 0)
{
(void)close(sock);
NSLog(@"unable to set reuse on socket - %s", GSLastErrorStr(errno));
NSLog(@"unable to set reuse on socket - %@", [_GSPrivate error]);
}
#endif
else if ((handle = [GSMessageHandle handleWithDescriptor: sock]) == nil)
{
(void)close(sock);
NSLog(@"unable to create GSMessageHandle - %s", GSLastErrorStr(errno));
NSLog(@"unable to create GSMessageHandle - %@", [_GSPrivate error]);
}
else
{