reds: Use socket_close instead of close

socket_close is mapped to close under Unix but under Windows
you should call closesocket instead so call socket_close which
will map to the proper close function on both environments.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <ulublin@redhat.com>
This commit is contained in:
Frediano Ziglio 2020-06-18 12:49:15 +01:00
parent 21323c8b6f
commit 8875e79c7c

View File

@ -2470,8 +2470,7 @@ static void reds_accept_ssl_connection(int fd, int event, void *data)
}
if (!(link = reds_init_client_ssl_connection(reds, socket))) {
close(socket);
return;
socket_close(socket);
}
}
@ -2486,8 +2485,9 @@ static void reds_accept(int fd, int event, void *data)
return;
}
if (spice_server_add_client(reds, socket, 0) < 0)
close(socket);
if (spice_server_add_client(reds, socket, 0) < 0) {
socket_close(socket);
}
}