From f538dd5276cc246d97c02a644f1976ec08056e74 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Thu, 27 Jun 2024 00:39:22 +0300 Subject: [PATCH] test-tcp: Fix printing of "connection reset" when tcp connection closed --- userspace/test-tcp/main.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/userspace/test-tcp/main.cpp b/userspace/test-tcp/main.cpp index 9234cbd0b1..b767996a8f 100644 --- a/userspace/test-tcp/main.cpp +++ b/userspace/test-tcp/main.cpp @@ -99,10 +99,9 @@ int main(int argc, char** argv) { ssize_t nrecv = recv(socket, buffer, sizeof(buffer), 0); if (nrecv == -1) - { perror("recv"); + if (nrecv <= 0) break; - } write(STDOUT_FILENO, buffer, nrecv); }