aboutsummaryrefslogtreecommitdiff
path: root/src/poll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/poll.c')
-rw-r--r--src/poll.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/poll.c b/src/poll.c
index f294a454..2b3c5ba2 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -612,11 +612,16 @@ int ssh_poll_ctx_dopoll(ssh_poll_ctx ctx, int timeout) {
if (!ctx->pollfds[i].revents) {
i++;
} else {
+ int ret;
+
p = ctx->pollptrs[i];
fd = ctx->pollfds[i].fd;
revents = ctx->pollfds[i].revents;
- if (p->cb && p->cb(p, fd, revents, p->cb_data) < 0) {
+ if (p->cb && (ret = p->cb(p, fd, revents, p->cb_data)) < 0) {
+ if (ret == -2) {
+ return -1;
+ }
/* the poll was removed, reload the used counter and start again */
used = ctx->polls_used;
i=0;