summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 19f57b7e4..13f9673b5 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -40,7 +40,11 @@ int timeout = 5;
40int maxfd; 40int maxfd;
41#define maxcon (maxfd - 10) 41#define maxcon (maxfd - 10)
42 42
43char *prog; 43#ifdef HAVE___PROGNAME
44extern char *__progname;
45#else
46char *__progname;
47#endif
44fd_set read_wait; 48fd_set read_wait;
45int ncon; 49int ncon;
46 50
@@ -544,7 +548,7 @@ nexthost(int argc, char **argv)
544static void 548static void
545usage(void) 549usage(void)
546{ 550{
547 fatal("usage: %s [-t timeout] { [--] host | -f file } ...\n", prog); 551 fatal("usage: %s [-t timeout] { [--] host | -f file } ...\n", __progname);
548 return; 552 return;
549} 553}
550 554
@@ -553,13 +557,9 @@ main(int argc, char **argv)
553{ 557{
554 char *host = NULL; 558 char *host = NULL;
555 559
560 __progname = get_progname(argv[0]);
556 TAILQ_INIT(&tq); 561 TAILQ_INIT(&tq);
557 562
558 if ((prog = strrchr(argv[0], '/')))
559 prog++;
560 else
561 prog = argv[0];
562
563 if (argc <= argno) 563 if (argc <= argno)
564 usage(); 564 usage();
565 565
@@ -580,11 +580,11 @@ main(int argc, char **argv)
580 580
581 maxfd = fdlim_get(1); 581 maxfd = fdlim_get(1);
582 if (maxfd < 0) 582 if (maxfd < 0)
583 fatal("%s: fdlim_get: bad value\n", prog); 583 fatal("%s: fdlim_get: bad value\n", __progname);
584 if (maxfd > MAXMAXFD) 584 if (maxfd > MAXMAXFD)
585 maxfd = MAXMAXFD; 585 maxfd = MAXMAXFD;
586 if (maxcon <= 0) 586 if (maxcon <= 0)
587 fatal("%s: not enough file descriptors\n", prog); 587 fatal("%s: not enough file descriptors\n", __progname);
588 if (maxfd > fdlim_get(0)) 588 if (maxfd > fdlim_get(0))
589 fdlim_set(maxfd); 589 fdlim_set(maxfd);
590 fdcon = xmalloc(maxfd * sizeof(con)); 590 fdcon = xmalloc(maxfd * sizeof(con));