FEXServerClient: Do not use strerror() in ConnectToServer()

This triggers glibc allocation.

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2024-11-20 01:57:17 +09:00
parent 44213c3968
commit a1aa2547ce

View File

@ -160,7 +160,7 @@ int ConnectToServer(ConnectionOption ConnectionOption) {
// Create the initial unix socket
int SocketFD = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (SocketFD == -1) {
LogMan::Msg::EFmt("Couldn't open AF_UNIX socket {} {}", errno, strerror(errno));
LogMan::Msg::EFmt("Couldn't open AF_UNIX socket {}", errno);
return -1;
}
@ -177,7 +177,7 @@ int ConnectToServer(ConnectionOption ConnectionOption) {
if (connect(SocketFD, reinterpret_cast<struct sockaddr*>(&addr), SizeOfAddr) == -1) {
if (ConnectionOption == ConnectionOption::Default || errno != ECONNREFUSED) {
LogMan::Msg::EFmt("Couldn't connect to FEXServer socket {} {} {}", ServerSocketName, errno, strerror(errno));
LogMan::Msg::EFmt("Couldn't connect to FEXServer socket {} {}", ServerSocketName, errno);
}
close(SocketFD);
return -1;