summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2000-12-13 17:45:15 +0000
committerKevin Steves <stevesk@pobox.com>2000-12-13 17:45:15 +0000
commitec84dc12db39c58e79b18928d75382ce31a9ee09 (patch)
tree991dba67b0a339da1b77ec0453499774c9c3ec4c /ssh-keyscan.c
parent152cea206a2c0aba018be8a299e9b028fae2d3bc (diff)
- (stevesk) OpenSSH CVS update:
- markus@cvs.openbsd.org 2000/12/12 15:30:02 [ssh-keyscan.c ssh.c sshd.c] consistently use __progname; from stevesk@pobox.com
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 19f57b7e..13f9673b 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -40,7 +40,11 @@ int timeout = 5;
int maxfd;
#define maxcon (maxfd - 10)
-char *prog;
+#ifdef HAVE___PROGNAME
+extern char *__progname;
+#else
+char *__progname;
+#endif
fd_set read_wait;
int ncon;
@@ -544,7 +548,7 @@ nexthost(int argc, char **argv)
static void
usage(void)
{
- fatal("usage: %s [-t timeout] { [--] host | -f file } ...\n", prog);
+ fatal("usage: %s [-t timeout] { [--] host | -f file } ...\n", __progname);
return;
}
@@ -553,13 +557,9 @@ main(int argc, char **argv)
{
char *host = NULL;
+ __progname = get_progname(argv[0]);
TAILQ_INIT(&tq);
- if ((prog = strrchr(argv[0], '/')))
- prog++;
- else
- prog = argv[0];
-
if (argc <= argno)
usage();
@@ -580,11 +580,11 @@ main(int argc, char **argv)
maxfd = fdlim_get(1);
if (maxfd < 0)
- fatal("%s: fdlim_get: bad value\n", prog);
+ fatal("%s: fdlim_get: bad value\n", __progname);
if (maxfd > MAXMAXFD)
maxfd = MAXMAXFD;
if (maxcon <= 0)
- fatal("%s: not enough file descriptors\n", prog);
+ fatal("%s: not enough file descriptors\n", __progname);
if (maxfd > fdlim_get(0))
fdlim_set(maxfd);
fdcon = xmalloc(maxfd * sizeof(con));