Account for Windows and UNIX socket API differences.
close is closesocket. Also some of the headers are different
and inet_aton should be inet_pton.
Change-Id: I9eee0880d91833bdd3bcf0f2a352923c9fb1a891
Reviewed-on: https://boringssl-review.googlesource.com/1864
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/bio/socket.c b/crypto/bio/socket.c
index 93dd512..90ae14a 100644
--- a/crypto/bio/socket.c
+++ b/crypto/bio/socket.c
@@ -66,6 +66,12 @@
#include "internal.h"
+#if !defined(OPENSSL_WINDOWS)
+static int closesocket(int sock) {
+ return close(sock);
+}
+#endif
+
static int sock_new(BIO *bio) {
bio->init = 0;
bio->num = 0;
@@ -81,7 +87,7 @@
if (bio->shutdown) {
if (bio->init) {
- close(bio->num);
+ closesocket(bio->num);
}
bio->init = 0;
bio->flags = 0;