mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
tweak for reporting error code of connection failure
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@33977 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9b24a41871
commit
9e781c5714
2 changed files with 10 additions and 4 deletions
|
@ -747,8 +747,10 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
{
|
||||
if (!GSWOULDBLOCK)
|
||||
{
|
||||
NSError *e = [NSError _last];
|
||||
|
||||
NSLog(@"unable to make connection to %@ - %@",
|
||||
GSPrivateSockaddrName(&sin), [NSError _last]);
|
||||
GSPrivateSockaddrName(&sin), e);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
}
|
||||
|
@ -829,8 +831,10 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
|||
|
||||
if (bind(net, &sin, GSPrivateSockaddrLength(&sin)) == -1)
|
||||
{
|
||||
NSError *e = [NSError _last];
|
||||
|
||||
NSLog(@"unable to bind to port %@ - %@",
|
||||
GSPrivateSockaddrName(&sin), [NSError _last]);
|
||||
GSPrivateSockaddrName(&sin), e);
|
||||
(void) close(net);
|
||||
DESTROY(self);
|
||||
return nil;
|
||||
|
|
|
@ -70,8 +70,10 @@
|
|||
#define INVALID_SOCKET -1
|
||||
#define BADSOCKET(X) ((X) < 0)
|
||||
#define GSNETERROR errno
|
||||
#define GSWOULDBLOCK (EINPROGRESS == GSNETERROR\
|
||||
|| EALREADY == GSNETERROR || EAGAIN == errno)
|
||||
#define GSWOULDBLOCK (EINPROGRESS == errno\
|
||||
|| EALREADY == errno\
|
||||
|| EINTR == errno\
|
||||
|| EAGAIN == errno)
|
||||
|
||||
#endif /* __MINGW__ */
|
||||
|
||||
|
|
Loading…
Reference in a new issue