diff options
author | Daniel Stenberg <daniel@haxx.se> | 2010-09-06 00:02:54 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2010-09-06 00:02:54 +0200 |
commit | c6fa1952a14ba2fa14f4a3483f1f573560ef3133 (patch) | |
tree | 08c88f75e74eb8e8f969234000579e25e76584f2 /lib/easy.c | |
parent | d47bd396cecd755c5f88d1e0c7b82a81bca8bd83 (diff) | |
download | curl-c6fa1952a14ba2fa14f4a3483f1f573560ef3133.tar.gz |
portabilty: use proper variable type to hold sockets
Curl_getconnectinfo() is changed to return a proper curl_socket_t for
the last socket so that it'll work more portably (and cause less
compiler warnings).
Diffstat (limited to 'lib/easy.c')
-rw-r--r-- | lib/easy.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/easy.c b/lib/easy.c index 637d99bb0..bebeeb17f 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -1072,9 +1072,6 @@ static CURLcode easy_connection(struct SessionHandle *data, curl_socket_t *sfd, struct connectdata **connp) { - CURLcode ret; - long sockfd; - if(data == NULL) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -1084,18 +1081,13 @@ static CURLcode easy_connection(struct SessionHandle *data, return CURLE_UNSUPPORTED_PROTOCOL; } - ret = Curl_getconnectinfo(data, &sockfd, connp); - if(ret != CURLE_OK) - return ret; + *sfd = Curl_getconnectinfo(data, connp); - if(sockfd == -1) { + if(*sfd == CURL_SOCKET_BAD) { failf(data, "Failed to get recent socket"); return CURLE_UNSUPPORTED_PROTOCOL; } - *sfd = (curl_socket_t)sockfd; /* we know that this is actually a socket - descriptor so the typecast is fine here */ - return CURLE_OK; } |