mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-17 06:18:58 +03:00
bind: Return different error if accept was interrupted
Fixes: https://gitlab.com/libssh/libssh-mirror/-/issues/13 Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
b312d4681e
commit
9e03bf9f1e
@@ -586,9 +586,15 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session)
|
|||||||
|
|
||||||
fd = accept(sshbind->bindfd, NULL, NULL);
|
fd = accept(sshbind->bindfd, NULL, NULL);
|
||||||
if (fd == SSH_INVALID_SOCKET) {
|
if (fd == SSH_INVALID_SOCKET) {
|
||||||
|
if (errno == EINTR) {
|
||||||
|
ssh_set_error(sshbind, SSH_EINTR,
|
||||||
|
"Accepting a new connection (child signal error): %s",
|
||||||
|
strerror(errno));
|
||||||
|
} else {
|
||||||
ssh_set_error(sshbind, SSH_FATAL,
|
ssh_set_error(sshbind, SSH_FATAL,
|
||||||
"Accepting a new connection: %s",
|
"Accepting a new connection: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
}
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
rc = ssh_bind_accept_fd(sshbind, session, fd);
|
rc = ssh_bind_accept_fd(sshbind, session, fd);
|
||||||
|
|||||||
Reference in New Issue
Block a user