mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
ac2c5d6090
commit
2756763d0f
2 changed files with 10 additions and 4 deletions
|
@ -747,8 +747,10 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
{
|
{
|
||||||
if (!GSWOULDBLOCK)
|
if (!GSWOULDBLOCK)
|
||||||
{
|
{
|
||||||
|
NSError *e = [NSError _last];
|
||||||
|
|
||||||
NSLog(@"unable to make connection to %@ - %@",
|
NSLog(@"unable to make connection to %@ - %@",
|
||||||
GSPrivateSockaddrName(&sin), [NSError _last]);
|
GSPrivateSockaddrName(&sin), e);
|
||||||
DESTROY(self);
|
DESTROY(self);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -829,8 +831,10 @@ NSString * const GSSOCKSRecvAddr = @"GSSOCKSRecvAddr";
|
||||||
|
|
||||||
if (bind(net, &sin, GSPrivateSockaddrLength(&sin)) == -1)
|
if (bind(net, &sin, GSPrivateSockaddrLength(&sin)) == -1)
|
||||||
{
|
{
|
||||||
|
NSError *e = [NSError _last];
|
||||||
|
|
||||||
NSLog(@"unable to bind to port %@ - %@",
|
NSLog(@"unable to bind to port %@ - %@",
|
||||||
GSPrivateSockaddrName(&sin), [NSError _last]);
|
GSPrivateSockaddrName(&sin), e);
|
||||||
(void) close(net);
|
(void) close(net);
|
||||||
DESTROY(self);
|
DESTROY(self);
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -70,8 +70,10 @@
|
||||||
#define INVALID_SOCKET -1
|
#define INVALID_SOCKET -1
|
||||||
#define BADSOCKET(X) ((X) < 0)
|
#define BADSOCKET(X) ((X) < 0)
|
||||||
#define GSNETERROR errno
|
#define GSNETERROR errno
|
||||||
#define GSWOULDBLOCK (EINPROGRESS == GSNETERROR\
|
#define GSWOULDBLOCK (EINPROGRESS == errno\
|
||||||
|| EALREADY == GSNETERROR || EAGAIN == errno)
|
|| EALREADY == errno\
|
||||||
|
|| EINTR == errno\
|
||||||
|
|| EAGAIN == errno)
|
||||||
|
|
||||||
#endif /* __MINGW__ */
|
#endif /* __MINGW__ */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue