diff options
author | Brent Cook <busterb@gmail.com> | 2023-07-06 22:05:06 +0300 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2023-07-06 22:05:06 +0300 |
commit | c9b18cb296c0f43d56b9dc9c1e05b57fc780c798 (patch) | |
tree | 292c8f7df9f9505222fde072d1d5336516c915a5 | |
parent | f75c00226cdae7a42b4ce30ee794ed6f8bc660cd (diff) | |
download | portable-c9b18cb296c0f43d56b9dc9c1e05b57fc780c798.tar.gz portable-c9b18cb296c0f43d56b9dc9c1e05b57fc780c798.tar.bz2 portable-c9b18cb296c0f43d56b9dc9c1e05b57fc780c798.zip |
fix get/setsockopt reversed logic
-rw-r--r-- | crypto/compat/posix_win.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/compat/posix_win.c b/crypto/compat/posix_win.c index 3f8b5f9..b3a4687 100644 --- a/crypto/compat/posix_win.c +++ b/crypto/compat/posix_win.c | |||
@@ -253,7 +253,7 @@ posix_getsockopt(int sockfd, int level, int optname, | |||
253 | int rc; | 253 | int rc; |
254 | if (is_socket(sockfd)) { | 254 | if (is_socket(sockfd)) { |
255 | rc = getsockopt(sockfd, level, optname, (char *)optval, optlen); | 255 | rc = getsockopt(sockfd, level, optname, (char *)optval, optlen); |
256 | if (rc == 0) { | 256 | if (rc != 0) { |
257 | rc = wsa_errno(WSAGetLastError()); | 257 | rc = wsa_errno(WSAGetLastError()); |
258 | } | 258 | } |
259 | } else { | 259 | } else { |
@@ -269,7 +269,7 @@ posix_setsockopt(int sockfd, int level, int optname, | |||
269 | int rc; | 269 | int rc; |
270 | if (is_socket(sockfd)) { | 270 | if (is_socket(sockfd)) { |
271 | rc = setsockopt(sockfd, level, optname, (char *)optval, optlen); | 271 | rc = setsockopt(sockfd, level, optname, (char *)optval, optlen); |
272 | if (rc == 0) { | 272 | if (rc != 0) { |
273 | rc = wsa_errno(WSAGetLastError()); | 273 | rc = wsa_errno(WSAGetLastError()); |
274 | } | 274 | } |
275 | } else { | 275 | } else { |