From e545e33d5fd4f021220f09cf8fb05c66db2a4bf4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Mar 2004 13:13:35 +0000 Subject: Gisle Vanem's fixes to use CURL_SOCKET_BAD more instead of -1 for sockets. --- lib/ftp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/ftp.c') diff --git a/lib/ftp.c b/lib/ftp.c index 3b417c9e1..758c918cc 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -166,7 +166,7 @@ static CURLcode AllowServerConnect(struct connectdata *conn) default: /* we have received data here */ { - int s; + curl_socket_t s; size_t size = sizeof(struct sockaddr_in); struct sockaddr_in add; @@ -175,7 +175,7 @@ static CURLcode AllowServerConnect(struct connectdata *conn) sclose(sock); /* close the first socket */ - if (-1 == s) { + if (CURL_SOCKET_BAD == s) { /* DIE! */ failf(data, "Error accept()ing server connect"); return CURLE_FTP_PORT_FAILED; @@ -766,7 +766,7 @@ CURLcode Curl_ftp_done(struct connectdata *conn) #endif /* shut down the socket to inform the server we're done */ sclose(conn->sock[SECONDARYSOCKET]); - conn->sock[SECONDARYSOCKET] = -1; + conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; if(!ftp->no_transfer) { /* Let's see what the server says about the transfer we just performed, @@ -2379,10 +2379,10 @@ CURLcode Curl_ftp(struct connectdata *conn) if(connected) retcode = Curl_ftp_nextconnect(conn); - if(retcode && (conn->sock[SECONDARYSOCKET] >= 0)) { + if(retcode && (conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD)) { /* Failure detected, close the second socket if it was created already */ sclose(conn->sock[SECONDARYSOCKET]); - conn->sock[SECONDARYSOCKET] = -1; + conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; } if(ftp->no_transfer) -- cgit v1.2.3