Skip to content

Commit

Permalink
Merge pull request #2164 from Sonicadvance1/debug_logs_on_bad_socket
Browse files Browse the repository at this point in the history
FEXServerClient: Add some debug logs for when FEX can't connect to se…
  • Loading branch information
Sonicadvance1 committed Nov 22, 2022
2 parents 58f35ba + e61eb24 commit 3c8da3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/Common/FEXServerClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ namespace FEXServerClient {
// Create the initial unix socket
int SocketFD = socket(AF_UNIX, SOCK_STREAM, 0);
if (SocketFD == -1) {
LogMan::Msg::EFmt("Couldn't open AF_UNIX socket {} {}", errno, strerror(errno));
return -1;
}

Expand All @@ -135,6 +136,7 @@ namespace FEXServerClient {
strncpy(addr.sun_path, ServerSocketFile.data(), std::min(ServerSocketFile.size(), sizeof(addr.sun_path)));

if (connect(SocketFD, reinterpret_cast<struct sockaddr*>(&addr), sizeof(addr)) == -1) {
LogMan::Msg::EFmt("Couldn't connect to FEXServer socket {} {} {}", ServerSocketFile, errno, strerror(errno));
close(SocketFD);
return -1;
}
Expand Down

0 comments on commit 3c8da3e

Please sign in to comment.