fix get/setsockopt reversed logic
This commit is contained in:
parent
f75c00226c
commit
c9b18cb296
@ -253,7 +253,7 @@ posix_getsockopt(int sockfd, int level, int optname,
|
|||||||
int rc;
|
int rc;
|
||||||
if (is_socket(sockfd)) {
|
if (is_socket(sockfd)) {
|
||||||
rc = getsockopt(sockfd, level, optname, (char *)optval, optlen);
|
rc = getsockopt(sockfd, level, optname, (char *)optval, optlen);
|
||||||
if (rc == 0) {
|
if (rc != 0) {
|
||||||
rc = wsa_errno(WSAGetLastError());
|
rc = wsa_errno(WSAGetLastError());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -269,7 +269,7 @@ posix_setsockopt(int sockfd, int level, int optname,
|
|||||||
int rc;
|
int rc;
|
||||||
if (is_socket(sockfd)) {
|
if (is_socket(sockfd)) {
|
||||||
rc = setsockopt(sockfd, level, optname, (char *)optval, optlen);
|
rc = setsockopt(sockfd, level, optname, (char *)optval, optlen);
|
||||||
if (rc == 0) {
|
if (rc != 0) {
|
||||||
rc = wsa_errno(WSAGetLastError());
|
rc = wsa_errno(WSAGetLastError());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user