From a6174cd0b609f882475db2af94f6559e5a5e6ff8 Mon Sep 17 00:00:00 2001 From: Jun-ichiro itojun Hagino Date: Wed, 18 Oct 2000 06:53:25 +0000 Subject: emit more easier-to-understand error message on port name error. from deraadt --- usr.bin/ftp/ftp.c | 9 ++++++--- 1 file 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); } -- cgit v1.2.3