From 628777f94acb92ea89798daedeaa2a4deac13b4b Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 2 May 2020 16:51:39 +0300 Subject: LibIPC: Abort on connection failure ...instead of looping for (effectively) ever. Fixes https://github.com/SerenityOS/serenity/issues/1869 --- Libraries/LibIPC/ServerConnection.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Libraries') diff --git a/Libraries/LibIPC/ServerConnection.h b/Libraries/LibIPC/ServerConnection.h index 949a078744..d9dad2b7fb 100644 --- a/Libraries/LibIPC/ServerConnection.h +++ b/Libraries/LibIPC/ServerConnection.h @@ -57,15 +57,9 @@ public: handle_messages(); }; - int retries = 100000; - while (retries) { - if (m_connection->connect(Core::SocketAddress::local(address))) { - break; - } - - dbgprintf("Client::Connection: connect failed: %d, %s\n", errno, strerror(errno)); - usleep(10000); - --retries; + if (!m_connection->connect(Core::SocketAddress::local(address))) { + perror("connect"); + ASSERT_NOT_REACHED(); } ucred creds; -- cgit v1.2.3