1
0
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:
Jakub Jelen
2022-05-23 15:42:21 +02:00
committed by Andreas Schneider
parent b312d4681e
commit 9e03bf9f1e

View File

@@ -586,9 +586,15 @@ int ssh_bind_accept(ssh_bind sshbind, ssh_session session)
fd = accept(sshbind->bindfd, NULL, NULL);
if (fd == SSH_INVALID_SOCKET) {
ssh_set_error(sshbind, SSH_FATAL,
"Accepting a new connection: %s",
strerror(errno));
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,
"Accepting a new connection: %s",
strerror(errno));
}
return SSH_ERROR;
}
rc = ssh_bind_accept_fd(sshbind, session, fd);