check that bind() returns success

This commit is contained in:
Daniel Stenberg 2005-09-04 18:33:20 +00:00
parent e55f502e2f
commit a3d776187a
1 changed files with 4 additions and 0 deletions

View File

@ -537,6 +537,10 @@ CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done)
/* Bind to any interface, random UDP port */
rc = bind(state->sockfd, &state->local_addr, sizeof(state->local_addr));
if(rc) {
failf(conn->data, "failed to bind\n");
return CURLE_COULDNT_CONNECT;
}
Curl_pgrsStartNow(conn->data);