mirror of
https://github.com/sheumann/telnetd.git
synced 2024-05-28 19:41:28 +00:00
Print "Trying ..." for each host. Also cleanups for error printing.
Approved by: jkh Submitted by: Ben Smithurst <ben@scientia.demon.co.uk> git-svn-id: http://svn0.us-east.freebsd.org/base/head/contrib/telnet@57342 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
This commit is contained in:
parent
c750243830
commit
62286e5a31
|
@ -2532,8 +2532,8 @@ tn(argc, argv)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("Trying %s...\n", sockaddr_ntop(res->ai_addr));
|
|
||||||
do {
|
do {
|
||||||
|
printf("Trying %s...\n", sockaddr_ntop(res->ai_addr));
|
||||||
net = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
net = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||||
setuid(getuid());
|
setuid(getuid());
|
||||||
if (net < 0) {
|
if (net < 0) {
|
||||||
|
@ -2609,18 +2609,13 @@ tn(argc, argv)
|
||||||
if (af_error != 0)
|
if (af_error != 0)
|
||||||
while (next != NULL && next->ai_family != res->ai_family)
|
while (next != NULL && next->ai_family != res->ai_family)
|
||||||
next = next->ai_next;
|
next = next->ai_next;
|
||||||
|
warn("connect to address %s", sockaddr_ntop(res->ai_addr));
|
||||||
if (next != NULL) {
|
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;
|
res = next;
|
||||||
(void) NetClose(net);
|
(void) NetClose(net);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
perror("telnet: Unable to connect to remote host");
|
warnx("Unable to connect to remote host");
|
||||||
(void) NetClose(net);
|
(void) NetClose(net);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user