From 2b82c83cebf15831f24196dbefd483f4a208de39 Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Tue, 5 Jul 2022 16:19:57 +0200 Subject: LookupServer: Use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX HOST_NAME_MAX is not defined on the BSDs, including macOS. Use _POSIX_HOST_NAME_MAX instead, which is defined on all the platforms. --- Userland/Services/LookupServer/LookupServer.cpp | 2 +- Userland/Services/LookupServer/MulticastDNS.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Services') diff --git a/Userland/Services/LookupServer/LookupServer.cpp b/Userland/Services/LookupServer/LookupServer.cpp index 714c26c1b0..747aafeccc 100644 --- a/Userland/Services/LookupServer/LookupServer.cpp +++ b/Userland/Services/LookupServer/LookupServer.cpp @@ -126,7 +126,7 @@ void LookupServer::load_etc_hosts() static String get_hostname() { - char buffer[HOST_NAME_MAX]; + char buffer[_POSIX_HOST_NAME_MAX]; VERIFY(gethostname(buffer, sizeof(buffer)) == 0); return buffer; } diff --git a/Userland/Services/LookupServer/MulticastDNS.cpp b/Userland/Services/LookupServer/MulticastDNS.cpp index 342c611584..b987334ec1 100644 --- a/Userland/Services/LookupServer/MulticastDNS.cpp +++ b/Userland/Services/LookupServer/MulticastDNS.cpp @@ -22,7 +22,7 @@ MulticastDNS::MulticastDNS(Object* parent) : Core::UDPServer(parent) , m_hostname("courage.local") { - char buffer[HOST_NAME_MAX]; + char buffer[_POSIX_HOST_NAME_MAX]; if (gethostname(buffer, sizeof(buffer)) < 0) { perror("gethostname"); } else { -- cgit v1.2.3