diff options
author | Kurt Roeckx <kurt@roeckx.be> | 2016-02-04 15:20:26 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2016-02-04 16:05:59 +0100 |
commit | c86d1f19fc69adacdd8d5955193330e18a0c7ebb (patch) | |
tree | 0cdc4f382ed3b3d3cd702610a264fddef78282d6 /crypto/bio | |
parent | df057ea6c8a20e4babc047689507dfafde59ffd6 (diff) |
Use WSAGetLastError() on windows
Windows doesn't have h_error or hstrerror()
Reviewed-by: Richard Levitte <levitte@openssl.org>
MR: #1848
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_addr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c index 8f94fe8ffb..61714e5602 100644 --- a/crypto/bio/b_addr.c +++ b/crypto/bio/b_addr.c @@ -715,8 +715,12 @@ int BIO_lookup(const char *host, const char *service, he = gethostbyname(host); if (he == NULL) { +#ifndef OPENSSL_SYS_WINDOWS BIOerr(BIO_F_BIO_LOOKUP, ERR_R_SYS_LIB); ERR_add_error_data(1, hstrerror(h_errno)); +#else + SYSerr(SYS_F_GETHOSTBYNAME, WSAGetLastError()); +#endif ret = 0; goto err; } @@ -747,8 +751,12 @@ int BIO_lookup(const char *host, const char *service, se = getservbyname(service, proto); if (se == NULL) { +#ifndef OPENSSL_SYS_WINDOWS BIOerr(BIO_F_BIO_LOOKUP, ERR_R_SYS_LIB); ERR_add_error_data(1, hstrerror(h_errno)); +#else + SYSerr(SYS_F_GETSERVBYNAME, WSAGetLastError()); +#endif goto err; } } else { |