- (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
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 19f57b7..13f9673 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -40,7 +40,11 @@
 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 @@
 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 @@
 {
 	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 @@
 
 	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));