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
92b68e1a4b
commit
3a1c25125a
@ -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