Skip to content

Commit

Permalink
Merge pull request #3527 from alebastr/hypr-getaddrinfo
Browse files Browse the repository at this point in the history
hyprland/backend: drop unnecessary getaddrinfo call
  • Loading branch information
Alexays authored Aug 26, 2024
2 parents 26329b6 + 1f23b30 commit f665d1d
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/modules/hyprland/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,12 @@ void IPC::unregisterForIPC(EventHandler* ev_handler) {
std::string IPC::getSocket1Reply(const std::string& rq) {
// basically hyprctl

struct addrinfo aiHints;
struct addrinfo* aiRes = nullptr;
const auto serverSocket = socket(AF_UNIX, SOCK_STREAM, 0);

if (serverSocket < 0) {
throw std::runtime_error("Hyprland IPC: Couldn't open a socket (1)");
}

memset(&aiHints, 0, sizeof(struct addrinfo));
aiHints.ai_family = AF_UNSPEC;
aiHints.ai_socktype = SOCK_STREAM;

if (getaddrinfo("localhost", nullptr, &aiHints, &aiRes) != 0) {
throw std::runtime_error("Hyprland IPC: Couldn't get host (2)");
}

// get the instance signature
auto* instanceSig = getenv("HYPRLAND_INSTANCE_SIGNATURE");

Expand Down

0 comments on commit f665d1d

Please sign in to comment.