summaryrefslogtreecommitdiffstats
path: root/src/poll.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/poll.c')
-rw-r--r--src/poll.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/poll.c b/src/poll.c
index 6507aad..078ac2e 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -84,27 +84,35 @@ static inline void handle_fd(fastd_poll_fd_t *fd, bool input, bool error) {
if (input)
fastd_iface_handle(iface);
- }
+
break;
+ }
case POLL_TYPE_SOCKET:
{
fastd_socket_t *sock = container_of(fd, fastd_socket_t, fd);
+
if (error) {
if (sock->peer)
fastd_peer_reset_socket(sock->peer);
else
fastd_socket_error(sock);
+
+ return;
}
- else if (input) {
+
+ if (input)
fastd_receive(sock);
- }
+
+ break;
}
- break;
default:
exit_bug("unknown FD type");
}
+
+ if (error)
+ exit_error("unexpected poll error");
}