- return correct errno in NETConnectFinished
This commit is contained in:
@ -319,7 +319,8 @@ int NETConnectFinished(mkChannel * self)
|
|||||||
struct timeval tmo = { 0, 0 };
|
struct timeval tmo = { 0, 0 };
|
||||||
int iret;
|
int iret;
|
||||||
int oldopts;
|
int oldopts;
|
||||||
|
int olderrno;
|
||||||
|
|
||||||
if (self->sockid == 0) {
|
if (self->sockid == 0) {
|
||||||
errno = ENOTCONN;
|
errno = ENOTCONN;
|
||||||
return -1;
|
return -1;
|
||||||
@ -357,7 +358,9 @@ int NETConnectFinished(mkChannel * self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* reset to blocking mode */
|
/* reset to blocking mode */
|
||||||
|
olderrno = errno;
|
||||||
fcntl(self->sockid, F_SETFL, oldopts | ~O_NONBLOCK);
|
fcntl(self->sockid, F_SETFL, oldopts | ~O_NONBLOCK);
|
||||||
|
errno = olderrno;
|
||||||
return iret;
|
return iret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user