diff options
Diffstat (limited to 'wget.c')
-rw-r--r-- | wget.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -291,24 +291,24 @@ void parse_url(char *url, char **uri_host, int *uri_port, char **uri_path) | |||
291 | 291 | ||
292 | FILE *open_socket(char *host, int port) | 292 | FILE *open_socket(char *host, int port) |
293 | { | 293 | { |
294 | struct sockaddr_in sin; | 294 | struct sockaddr_in s_in; |
295 | struct hostent *hp; | 295 | struct hostent *hp; |
296 | int fd; | 296 | int fd; |
297 | FILE *fp; | 297 | FILE *fp; |
298 | 298 | ||
299 | memset(&sin, 0, sizeof(sin)); | 299 | memset(&s_in, 0, sizeof(s_in)); |
300 | sin.sin_family = AF_INET; | 300 | s_in.sin_family = AF_INET; |
301 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) | 301 | if ((hp = (struct hostent *) gethostbyname(host)) == NULL) |
302 | error_msg_and_die("cannot resolve %s", host); | 302 | error_msg_and_die("cannot resolve %s", host); |
303 | memcpy(&sin.sin_addr, hp->h_addr_list[0], hp->h_length); | 303 | memcpy(&s_in.sin_addr, hp->h_addr_list[0], hp->h_length); |
304 | sin.sin_port = htons(port); | 304 | s_in.sin_port = htons(port); |
305 | 305 | ||
306 | /* | 306 | /* |
307 | * Get the server onto a stdio stream. | 307 | * Get the server onto a stdio stream. |
308 | */ | 308 | */ |
309 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) | 309 | if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) |
310 | perror_msg_and_die("socket()"); | 310 | perror_msg_and_die("socket()"); |
311 | if (connect(fd, (struct sockaddr *) &sin, sizeof(sin)) < 0) | 311 | if (connect(fd, (struct sockaddr *) &s_in, sizeof(s_in)) < 0) |
312 | perror_msg_and_die("connect(%s)", host); | 312 | perror_msg_and_die("connect(%s)", host); |
313 | if ((fp = fdopen(fd, "r+")) == NULL) | 313 | if ((fp = fdopen(fd, "r+")) == NULL) |
314 | perror_msg_and_die("fdopen()"); | 314 | perror_msg_and_die("fdopen()"); |
@@ -534,7 +534,7 @@ progressmeter(int flag) | |||
534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 534 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
535 | * SUCH DAMAGE. | 535 | * SUCH DAMAGE. |
536 | * | 536 | * |
537 | * $Id: wget.c,v 1.29 2001/03/09 21:24:12 andersen Exp $ | 537 | * $Id: wget.c,v 1.30 2001/03/21 07:34:26 andersen Exp $ |
538 | */ | 538 | */ |
539 | 539 | ||
540 | 540 | ||