explicitly use SOCK_STREAM with socket() instead of res->ai_socktype,

because it appears that linux with glibc doesn't set the latter
correctly after one of getaddrinfo() or getnameinfo().
This commit is contained in:
lukem 2000-09-28 12:29:23 +00:00
parent ddc9ba4e19
commit 0aa81b3ec3
3 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fetch.c,v 1.124 2000/08/28 12:06:11 lukem Exp $ */
/* $NetBSD: fetch.c,v 1.125 2000/09/28 12:29:23 lukem Exp $ */
/*-
* Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: fetch.c,v 1.124 2000/08/28 12:06:11 lukem Exp $");
__RCSID("$NetBSD: fetch.c,v 1.125 2000/09/28 12:29:23 lukem Exp $");
#endif /* not lint */
/*
@ -670,8 +670,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth)
((struct sockaddr_in *)res->ai_addr)->sin_port =
htons(portnum);
s = socket(res->ai_family, res->ai_socktype,
res->ai_protocol);
s = socket(res->ai_family, SOCK_STREAM,
res->ai_protocol);
if (s < 0) {
warn("Can't create socket");
continue;
@ -1736,7 +1736,7 @@ auto_put(int argc, char **argv, const char *uploadserver)
}
}
if (debug)
fprintf(ttyout, "autoput: url `%s' argv[2] `%s'\n",
fprintf(ttyout, "auto_put: url `%s' argv[2] `%s'\n",
path, uargv[2] ? uargv[2] : "<null>");
/* connect and cwd */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ftp.c,v 1.108 2000/08/06 08:51:22 lukem Exp $ */
/* $NetBSD: ftp.c,v 1.109 2000/09/28 12:29:24 lukem Exp $ */
/*-
* Copyright (c) 1996-2000 The NetBSD Foundation, Inc.
@ -103,7 +103,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
__RCSID("$NetBSD: ftp.c,v 1.108 2000/08/06 08:51:22 lukem Exp $");
__RCSID("$NetBSD: ftp.c,v 1.109 2000/09/28 12:29:24 lukem Exp $");
#endif
#endif /* not lint */
@ -228,7 +228,7 @@ hookup(char *host, char *port)
fprintf(ttyout, "Trying %s...\n", hbuf);
}
((struct sockaddr_in *)res->ai_addr)->sin_port = htons(portnum);
s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol);
if (s < 0) {
cause = "socket";
continue;

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.20 2000/08/06 08:51:23 lukem Exp $ */
/* $NetBSD: version.h,v 1.21 2000/09/28 12:29:24 lukem Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
@ -40,5 +40,5 @@
#endif
#ifndef FTP_VERSION
#define FTP_VERSION "20000806"
#define FTP_VERSION "20000928"
#endif