1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00

fix(server): Fix unrelevant error message when using UDS.

Also fixes #248.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
This commit is contained in:
Roman Gershman 2022-08-19 15:26:19 +03:00
parent 08cda413f7
commit 7d2298b95a
2 changed files with 13 additions and 2 deletions

2
helio

@ -1 +1 @@
Subproject commit a2fffa3132683fa61f53f9e80caa57e4f714f0bc
Subproject commit d03ea0cae7d21de11391d2146e46f31457c7cef2

View file

@ -158,7 +158,18 @@ error_code Listener::ConfigureServerSocket(int fd) {
}
bool success = ConfigureKeepAlive(fd, kInterval);
LOG_IF(WARNING, !success) << "Could not configure keep alive " << detail::SafeErrorMessage(errno);
if (!success) {
int myerr = errno;
int socket_type;
socklen_t length = sizeof(socket_type);
// Ignore the error on UDS.
if (getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &socket_type, &length) != 0 ||
socket_type != AF_UNIX) {
LOG(WARNING) << "Could not configure keep alive " << detail::SafeErrorMessage(myerr);
}
}
return error_code{};
}