aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-01-29 16:38:43 +0000
committerYang Tse <yangsita@gmail.com>2010-01-29 16:38:43 +0000
commit4ee4e66c4f0b8bb765f30fffb175ae6cbbca8677 (patch)
treee421462cf92d74210a85df23ce07ac33360f288b
parent4d19ebe7381583efa7f7d97e30f6fe8de4650905 (diff)
fix errno usage for WIN32 builds
-rw-r--r--lib/ftp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 00b1a8ef2..855c0deb5 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -876,14 +876,15 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
/* Try binding the given address. */
if(bind(portsock, sa, sslen) ) {
/* It failed. */
- if(errno == EADDRNOTAVAIL) {
+ error = SOCKERRNO;
+ if(error == EADDRNOTAVAIL) {
/* The requested bind address is not local
* use the address used forthe control connection instead
* restart the port loop
*/
failf(data, "bind(port=%i) failed: %s", port,
- Curl_strerror(conn, SOCKERRNO) );
+ Curl_strerror(conn, error) );
sslen = sizeof(ss);
if(getsockname(conn->sock[FIRSTSOCKET], sa, &sslen)) {
@@ -895,9 +896,9 @@ static CURLcode ftp_state_use_port(struct connectdata *conn,
port = port_min;
continue;
}else
- if(errno != EADDRINUSE && errno != EACCES) {
+ if(error != EADDRINUSE && error != EACCES) {
failf(data, "bind(port=%i) failed: %s", port,
- Curl_strerror(conn, SOCKERRNO) );
+ Curl_strerror(conn, error) );
sclose(portsock);
return CURLE_FTP_PORT_FAILED;
}