From c6fa1952a14ba2fa14f4a3483f1f573560ef3133 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 6 Sep 2010 00:02:54 +0200 Subject: 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). --- lib/easy.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lib/easy.c') 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; } -- cgit v1.2.3