Add missing initialization of the length variable passed to
getsockopt(). Use a separate variable for clarity, instead of overloading an unrelated variable.
This commit is contained in:
parent
13950bd2ed
commit
d89bd1ac0f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=38290
@ -42,7 +42,7 @@ int
|
||||
connect(int fd, const struct sockaddr * name, int namelen)
|
||||
{
|
||||
struct sockaddr tmpname;
|
||||
int ret, tmpnamelen;
|
||||
int errnolen, ret, tmpnamelen;
|
||||
|
||||
if ((ret = _FD_LOCK(fd, FD_RDWR, NULL)) == 0) {
|
||||
if ((ret = _thread_sys_connect(fd, name, namelen)) < 0) {
|
||||
@ -63,7 +63,8 @@ connect(int fd, const struct sockaddr * name, int namelen)
|
||||
* Get the error, this function
|
||||
* should not fail
|
||||
*/
|
||||
_thread_sys_getsockopt(fd, SOL_SOCKET, SO_ERROR, &errno, &tmpnamelen);
|
||||
errnolen = sizeof(errno);
|
||||
_thread_sys_getsockopt(fd, SOL_SOCKET, SO_ERROR, &errno, &errnolen);
|
||||
}
|
||||
} else {
|
||||
ret = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user