From f3dad64a3b31667f4e9ea98f838a1bd934616164 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 9 Jan 2020 21:33:03 +0100 Subject: [PATCH] LibC: Fail name lookups immediately if we can't connect to LookupServer --- Libraries/LibC/netdb.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Libraries/LibC/netdb.cpp b/Libraries/LibC/netdb.cpp index 9a74e7d155b..b4e2bf1b982 100644 --- a/Libraries/LibC/netdb.cpp +++ b/Libraries/LibC/netdb.cpp @@ -38,6 +38,10 @@ static int connect_to_lookup_server() rc = connect(fd, (const sockaddr*)&address, sizeof(address)); if (rc == 0) break; + if (rc < 0) { + perror("connect_to_lookup_server"); + break; + } --retries; sleep(1); }