From 2a6000a6e194167e60c3b4b22e5f70229ac0ce2f Mon Sep 17 00:00:00 2001 From: Guillaume Meunier Date: Sun, 29 Sep 2024 10:50:46 +0200 Subject: [PATCH] Create the socket directory in the non-systemd case --- server/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/main.cpp b/server/main.cpp index 5e288683..1353f95c 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -56,7 +56,6 @@ static std::unique_ptr listener; std::optional> wivrn_ipc_socket_main_loop; std::optional> wivrn_ipc_socket_monado; -#ifdef WIVRN_USE_SYSTEMD std::filesystem::path socket_path() { char sock_file[PATH_MAX]; @@ -65,14 +64,13 @@ std::filesystem::path socket_path() return {sock_file, sock_file + size}; } +#ifdef WIVRN_USE_SYSTEMD int create_listen_socket() { sockaddr_un addr{}; auto sock_file = socket_path(); - std::filesystem::create_directories(sock_file.parent_path()); - addr.sun_family = AF_UNIX; strcpy(addr.sun_path, sock_file.c_str()); @@ -599,6 +597,8 @@ int inner_main(int argc, char * argv[], bool show_instructions) std::cerr << "For Steam games, set command to " << steam_command() << std::endl; } + std::filesystem::create_directories(socket_path().parent_path()); + #ifdef WIVRN_USE_SYSTEMD create_listen_socket(); #else