diff options
author | shin <shin@FreeBSD.org> | 2000-02-19 16:17:41 +0000 |
---|---|---|
committer | shin <shin@FreeBSD.org> | 2000-02-19 16:17:41 +0000 |
commit | e1b335a34c340068c8d744b46a335f8253a9bdd2 (patch) | |
tree | 7173c072dba116267b9aee10d83f55194fc86247 /crypto/telnet | |
parent | 2c906dc9722e8b521dc0478ac28b65280a894798 (diff) | |
download | FreeBSD-src-e1b335a34c340068c8d744b46a335f8253a9bdd2.zip FreeBSD-src-e1b335a34c340068c8d744b46a335f8253a9bdd2.tar.gz |
Print "Trying ..." for each host. Also cleanups for error printing.
Approved by: jkh
Submitted by: Ben Smithurst <ben@scientia.demon.co.uk>
Diffstat (limited to 'crypto/telnet')
-rw-r--r-- | crypto/telnet/telnet/commands.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/telnet/telnet/commands.c b/crypto/telnet/telnet/commands.c index 11cc055..24e5e43 100644 --- a/crypto/telnet/telnet/commands.c +++ b/crypto/telnet/telnet/commands.c @@ -2532,8 +2532,8 @@ tn(argc, argv) goto fail; } } - printf("Trying %s...\n", sockaddr_ntop(res->ai_addr)); do { + printf("Trying %s...\n", sockaddr_ntop(res->ai_addr)); net = socket(res->ai_family, res->ai_socktype, res->ai_protocol); setuid(getuid()); if (net < 0) { @@ -2609,18 +2609,13 @@ tn(argc, argv) if (af_error != 0) while (next != NULL && next->ai_family != res->ai_family) next = next->ai_next; + warn("connect to address %s", sockaddr_ntop(res->ai_addr)); if (next != NULL) { - int oerrno = errno; - - fprintf(stderr, "telnet: connect to address %s: ", - sockaddr_ntop(res->ai_addr)); - errno = oerrno; - perror((char *)0); res = next; (void) NetClose(net); continue; } - perror("telnet: Unable to connect to remote host"); + warnx("Unable to connect to remote host"); (void) NetClose(net); goto fail; } |