From ab353fd4e16d2ddae8098b4bc2d71682497eb375 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 15 Jul 2021 21:17:43 +1000 Subject: [PATCH] LibIPC: Close the socket and die when the peer is closed This will close the socket when the recv() returns 0 indicating that the peer has shutdown, and when there are no pending bytes to be processed. --- Userland/Libraries/LibIPC/Connection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibIPC/Connection.h b/Userland/Libraries/LibIPC/Connection.h index c6d66dcd66..19815de71f 100644 --- a/Userland/Libraries/LibIPC/Connection.h +++ b/Userland/Libraries/LibIPC/Connection.h @@ -196,7 +196,7 @@ protected: } if (nread == 0) { if (bytes.is_empty()) { - deferred_invoke([this](auto&) { die(); }); + deferred_invoke([this](auto&) { shutdown(); }); } return false; }