This commit is contained in:
Uwe Seimet 2023-11-12 09:26:06 +01:00
parent c59a300a97
commit 4c591100be
1 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,8 @@ string PiscsiService::Init(const callback& cb, int port)
server.sin_family = PF_INET;
server.sin_port = htons((uint16_t)port);
server.sin_addr.s_addr = INADDR_ANY;
if (bind(service_socket, reinterpret_cast<const sockaddr *>(&server), sizeof(sockaddr_in)) < 0) { //NOSONAR bit_cast is not supported by the bullseye compiler
if (bind(service_socket, reinterpret_cast<const sockaddr*>(&server),
static_cast<socklen_t>(sizeof(sockaddr_in))) < 0) { //NOSONAR bit_cast is not supported by the bullseye compiler
Stop();
return "Port " + to_string(port) + " is in use, is piscsi already running?";
}