aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-15 13:55:24 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-15 13:55:24 +0000
commit0d3aa8b7be9c3f8423359d090148fb7da0e5ea49 (patch)
tree3d0cebfe2a26a3d990298cd52b81cdcfa2bb62ab
parent496bbceef172992389fe71db07549cf176d0ea5a (diff)
Use the was_iface variable when binding a socket locally, even if no
SO_BINDTODEVICE is present, to prevent compiler warnings about the variable
-rw-r--r--lib/connect.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/connect.c b/lib/connect.c
index c9578c178..97d5d34d0 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -244,23 +244,20 @@ static CURLcode bindlocal(struct connectdata *conn,
if(h)
was_iface = TRUE;
-
}
- else {
- if(strlen(data->set.device)>1) {
- /*
- * This was not an interface, resolve the name as a host name
- * or IP number
- */
- rc = Curl_resolv(conn, data->set.device, 0, &h);
- if(rc == 1)
- (void)Curl_wait_for_resolv(conn, &h);
- if(h)
- /* we know data->set.device is shorter than the myhost array */
- strcpy(myhost, data->set.device);
+ if(!was_iface) {
+ /*
+ * This was not an interface, resolve the name as a host name
+ * or IP number
+ */
+ rc = Curl_resolv(conn, data->set.device, 0, &h);
+ if(rc == 1)
+ (void)Curl_wait_for_resolv(conn, &h);
- }
+ if(h)
+ /* we know data->set.device is shorter than the myhost array */
+ strcpy(myhost, data->set.device);
}
if(! *myhost) {