Skip to content

Commit

Permalink
Merge pull request #1916 from Sonicadvance1/server_socket_path_override
Browse files Browse the repository at this point in the history
FEXServer: Support socket path override
  • Loading branch information
Sonicadvance1 authored Aug 13, 2022
2 parents 9de25c2 + fe1f00a commit a2f4f49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions External/FEXCore/Source/Interface/Config/Config.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,13 @@
"Desc": [
"Loads an AOT IR cache for the loaded executable."
]
},
"ServerSocketPath": {
"Type": "str",
"Default": "",
"Desc": [
"Override for a FEXServer socket path. Only useful for chroots."
]
}
}
},
Expand Down
7 changes: 6 additions & 1 deletion Source/Common/FEXServerClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,12 @@ namespace FEXServerClient {
}

std::string GetServerSocketFile() {
return fmt::format("{}/{}.FEXServer.socket", std::filesystem::temp_directory_path().string(), ::geteuid());
FEX_CONFIG_OPT(ServerSocketPath, SERVERSOCKETPATH);
if (ServerSocketPath().empty()) {
return fmt::format("{}/{}.FEXServer.socket", std::filesystem::temp_directory_path().string(), ::geteuid());
}

return ServerSocketPath;
}

int GetServerFD() {
Expand Down

0 comments on commit a2f4f49

Please sign in to comment.