mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-29 01:03:57 +03:00
socket: Check return value of getsockopt().
This commit is contained in:
@@ -230,7 +230,10 @@ int ssh_socket_pollcallback(struct ssh_poll_handle_struct *p, socket_t fd, int r
|
||||
/* Check if we are in a connecting state */
|
||||
if(s->state==SSH_SOCKET_CONNECTING){
|
||||
s->state=SSH_SOCKET_ERROR;
|
||||
getsockopt(fd,SOL_SOCKET,SO_ERROR,(char *)&err,&errlen);
|
||||
r = getsockopt(fd, SOL_SOCKET, SO_ERROR, (char *)&err, &errlen);
|
||||
if (r < 0) {
|
||||
err = errno;
|
||||
}
|
||||
s->last_errno=err;
|
||||
ssh_socket_close(s);
|
||||
if(s->callbacks && s->callbacks->connected)
|
||||
|
||||
Reference in New Issue
Block a user