- return correct errno in NETConnectFinished

This commit is contained in:
zolliker
2012-06-19 07:05:41 +00:00
parent 8a817c5e30
commit bf04c301ca

View File

@ -319,6 +319,7 @@ int NETConnectFinished(mkChannel * self)
struct timeval tmo = { 0, 0 };
int iret;
int oldopts;
int olderrno;
if (self->sockid == 0) {
errno = ENOTCONN;
@ -357,7 +358,9 @@ int NETConnectFinished(mkChannel * self)
}
}
/* reset to blocking mode */
olderrno = errno;
fcntl(self->sockid, F_SETFL, oldopts | ~O_NONBLOCK);
errno = olderrno;
return iret;
}