summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/fastd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fastd.c b/src/fastd.c
index d43784f..380f6a2 100644
--- a/src/fastd.c
+++ b/src/fastd.c
@@ -780,8 +780,8 @@ static void handle_socket(fastd_context_t *ctx, fastd_socket_t *sock) {
socklen_t recvaddrlen = sizeof(recvaddr);
ssize_t len = recvfrom(sock->fd, buffer.data, buffer.len, 0, (struct sockaddr*)&recvaddr, &recvaddrlen);
- if (len < 0) {
- if (errno != EINTR)
+ if (len <= 0) {
+ if (len < 0 && errno != EINTR)
pr_warn(ctx, "recvfrom: %s", strerror(errno));
fastd_buffer_free(buffer);