From dc9f8764462ec5bf4ca44e4a447fae05037f7dc5e134ae56794ab5e51ea633e5 Mon Sep 17 00:00:00 2001 From: Soc Virnyl Estela Date: Fri, 2 Dec 2022 14:24:46 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/X11:Wayland/waybar?expand=0&rev=93 --- 0000-replace-gethostbyname-getaddrinfo.patch | 25 ++++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/0000-replace-gethostbyname-getaddrinfo.patch b/0000-replace-gethostbyname-getaddrinfo.patch index fd80e9b..b49ba66 100644 --- a/0000-replace-gethostbyname-getaddrinfo.patch +++ b/0000-replace-gethostbyname-getaddrinfo.patch @@ -1,13 +1,28 @@ diff --git a/src/modules/hyprland/backend.cpp b/src/modules/hyprland/backend.cpp -index 76c071c..f110825 100644 +index f110825..33212c7 100644 --- a/src/modules/hyprland/backend.cpp +++ b/src/modules/hyprland/backend.cpp -@@ -140,7 +140,7 @@ std::string IPC::getSocket1Reply(const std::string& rq) { +@@ -132,15 +132,20 @@ void IPC::unregisterForIPC(EventHandler* ev_handler) { + + std::string IPC::getSocket1Reply(const std::string& rq) { + // basically hyprctl +- ++ ++ struct addrinfo ai_hints; ++ struct addrinfo *ai_res = NULL; + const auto SERVERSOCKET = socket(AF_UNIX, SOCK_STREAM, 0); + + if (SERVERSOCKET < 0) { + spdlog::error("Hyprland IPC: Couldn't open a socket (1)"); return ""; } - -- const auto SERVER = gethostbyname("localhost"); -+ const auto SERVER = getaddrinfo("localhost", NULL, NULL, 0); +- +- const auto SERVER = getaddrinfo("localhost", NULL, NULL, 0); ++ ++ memset(&ai_hints, 0, sizeof(struct addrinfo)); ++ ai_hints.ai_family = AF_UNSPEC; ++ ai_hints.ai_socktype = SOCK_STREAM; ++ const auto SERVER = getaddrinfo("localhost", NULL, &ai_hints, &ai_res); if (!SERVER) { spdlog::error("Hyprland IPC: Couldn't get host (2)");