summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-10 12:41:50 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-10 13:52:20 +0100
commit8f20b173fd40d7f4c7d593e3070187a482b5352e (patch)
tree851387a37bad25ec1a5a160147c61591918f41a8 /Libraries/LibC
parent7380c8ec6e679280581beaf0d994297bb5a6a616 (diff)
downloadserenity-8f20b173fd40d7f4c7d593e3070187a482b5352e.zip
LibC: Remove useless retry loop in connect_to_lookup_server()
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/netdb.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/Libraries/LibC/netdb.cpp b/Libraries/LibC/netdb.cpp
index b4e2bf1b98..14a140b0fb 100644
--- a/Libraries/LibC/netdb.cpp
+++ b/Libraries/LibC/netdb.cpp
@@ -1,6 +1,6 @@
-#include <AK/String.h>
#include <AK/Assertions.h>
#include <AK/ScopeGuard.h>
+#include <AK/String.h>
#include <Kernel/Net/IPv4.h>
#include <arpa/inet.h>
#include <netdb.h>
@@ -32,21 +32,8 @@ static int connect_to_lookup_server()
address.sun_family = AF_LOCAL;
strcpy(address.sun_path, "/tmp/portal/lookup");
- int retries = 3;
- int rc = 0;
- while (retries) {
- rc = connect(fd, (const sockaddr*)&address, sizeof(address));
- if (rc == 0)
- break;
- if (rc < 0) {
- perror("connect_to_lookup_server");
- break;
- }
- --retries;
- sleep(1);
- }
-
- if (rc < 0) {
+ if (connect(fd, (const sockaddr*)&address, sizeof(address)) < 0) {
+ perror("connect_to_lookup_server");
close(fd);
return -1;
}