summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-10-18 06:53:25 +0000
committerJun-ichiro itojun Hagino <itojun@cvs.openbsd.org>2000-10-18 06:53:25 +0000
commita6174cd0b609f882475db2af94f6559e5a5e6ff8 (patch)
tree34c85025ce8ff008ef78d5066a60d37205b79768 /usr.bin/ftp
parent0fdd57381e37d76f05d52ffdd00f5153268c9657 (diff)
emit more easier-to-understand error message on port name error. from deraadt
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/ftp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 0e360768ff8..1d3ee791e05 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.38 2000/06/30 16:00:14 millert Exp $ */
+/* $OpenBSD: ftp.c,v 1.39 2000/10/18 06:53:24 itojun Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -67,7 +67,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-static char rcsid[] = "$OpenBSD: ftp.c,v 1.38 2000/06/30 16:00:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: ftp.c,v 1.39 2000/10/18 06:53:24 itojun Exp $";
#endif
#endif /* not lint */
@@ -165,7 +165,10 @@ hookup(host, port)
error = getaddrinfo(host, pbuf, &hints, &res0);
}
if (error) {
- warn("%s", gai_strerror(error));
+ if (error == EAI_SERVICE)
+ warnx("%s: bad port number `%s'", host, port);
+ else
+ warnx("%s: %s", host, gai_strerror(error));
code = -1;
return (0);
}