diff options
author | Yang Tse <yangsita@gmail.com> | 2008-10-13 06:16:02 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-10-13 06:16:02 +0000 |
commit | c3a959cc37d69f2634fa3b6a0a4775c7cf08ce27 (patch) | |
tree | 72f57487c1f786089a99bbac6ba812627d7b9502 | |
parent | ca70beec479f40f87610b964ebe0bab4ed07edac (diff) |
There's no guarantee that a socket was involved at this point, so avoid displaying any error code.
And on the other hand a message after setsockopt() certainly must use SOCKERRNO.
-rw-r--r-- | lib/connect.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/connect.c b/lib/connect.c index 51857ec8d..3a90a65b0 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -359,9 +359,7 @@ static CURLcode bindlocal(struct connectdata *conn, hostent_buf, sizeof(hostent_buf)); */ - data->state.os_errno = error = SOCKERRNO; - failf(data, "Couldn't bind to '%s', failed with errno %d: %s", - dev, error, Curl_strerror(conn, error)); + failf(data, "Couldn't bind to '%s'", dev); if(h) Curl_resolv_unlock(data, h); return CURLE_INTERFACE_FAILED; @@ -387,7 +385,7 @@ static CURLcode bindlocal(struct connectdata *conn, */ if(setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1) != 0) { - error = ERRNO; + error = SOCKERRNO; infof(data, "SO_BINDTODEVICE %s failed with errno %d: %s; will do regular bind\n", dev, error, Curl_strerror(conn, error)); /* This is typically "errno 1, error: Operation not permitted" if |