[Spice-commits] server/reds.cpp
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 18 15:58:15 UTC 2020
server/reds.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 8875e79c7cccb1080707fea01f784ff6e0fe471e
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Thu Jun 18 12:49:15 2020 +0100
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 at gmail.com>
Acked-by: Uri Lublin <ulublin at redhat.com>
diff --git a/server/reds.cpp b/server/reds.cpp
index 10841b68..1abb9fe9 100644
--- a/server/reds.cpp
+++ b/server/reds.cpp
@@ -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);
+ }
}
More information about the Spice-commits
mailing list