- return correct errno in NETConnectFinished
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user