diff options
author | Sergey Bugaev <bugaevc@serenityos.org> | 2020-05-02 16:51:39 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-02 15:59:37 +0200 |
commit | 628777f94acb92ea89798daedeaa2a4deac13b4b (patch) | |
tree | 0aadc8a46f5cebd61606d09148711fef53ff7c40 /Libraries | |
parent | d5582596a9e4ff6709bd8d81b5c08d873548879a (diff) | |
download | serenity-628777f94acb92ea89798daedeaa2a4deac13b4b.zip |
LibIPC: Abort on connection failure
...instead of looping for (effectively) ever.
Fixes https://github.com/SerenityOS/serenity/issues/1869
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibIPC/ServerConnection.h | 12 |
1 files changed, 3 insertions, 9 deletions
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; |