convert to use getprogname()

This commit is contained in:
cgd
2001-02-19 23:22:40 +00:00
parent 57ac6470b4
commit 3857fe5343
5 changed files with 25 additions and 31 deletions

View File

@@ -1,4 +1,4 @@
/* $NetBSD: mopa.out.c,v 1.6 2000/05/20 10:58:05 ragge Exp $ */
/* $NetBSD: mopa.out.c,v 1.7 2001/02/19 23:22:44 cgd Exp $ */
/* mopa.out - Convert a Unix format kernel into something that
* can be transfered via MOP.
@@ -49,7 +49,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: mopa.out.c,v 1.6 2000/05/20 10:58:05 ragge Exp $");
__RCSID("$NetBSD: mopa.out.c,v 1.7 2001/02/19 23:22:44 cgd Exp $");
#endif
#include "os.h"
@@ -80,14 +80,13 @@ main (int argc, char **argv)
int i;
struct dllist dl;
extern char *__progname; /* from crt0.o */
#ifdef NOAOUT
errx(1, "has no function in NetBSD");
#endif
if (argc != 3) {
fprintf (stderr, "usage: %s kernel-in sys-out\n", __progname);
fprintf (stderr, "usage: %s kernel-in sys-out\n",
getprogname());
return (1);
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: mopchk.c,v 1.7 2001/01/11 01:42:50 lukem Exp $ */
/* $NetBSD: mopchk.c,v 1.8 2001/02/19 23:22:45 cgd Exp $ */
/*
* Copyright (c) 1995-96 Mats O Jansson. All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: mopchk.c,v 1.7 2001/01/11 01:42:50 lukem Exp $");
__RCSID("$NetBSD: mopchk.c,v 1.8 2001/02/19 23:22:45 cgd Exp $");
#endif
/*
@@ -61,7 +61,6 @@ int AllFlag = 0; /* listen on "all" interfaces */
int VersionFlag = 0; /* Show version */
int promisc = 0; /* promisc mode not needed */
extern char *__progname; /* from crt0.o */
extern char version[];
int
@@ -93,7 +92,7 @@ main(argc, argv)
}
if (VersionFlag)
printf("%s: Version %s\n", __progname, version);
printf("%s: Version %s\n", getprogname(), version);
if (AllFlag) {
if (VersionFlag)
@@ -151,7 +150,7 @@ void
Usage()
{
(void) fprintf(stderr, "usage: %s [-a] [-v] [filename...]\n",
__progname);
getprogname());
exit(1);
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: mopd.c,v 1.7 2001/01/11 01:42:50 lukem Exp $ */
/* $NetBSD: mopd.c,v 1.8 2001/02/19 23:22:45 cgd Exp $ */
/*
* Copyright (c) 1993-96 Mats O Jansson. All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: mopd.c,v 1.7 2001/01/11 01:42:50 lukem Exp $");
__RCSID("$NetBSD: mopd.c,v 1.8 2001/02/19 23:22:45 cgd Exp $");
#endif
/*
@@ -73,8 +73,6 @@ int Not3Flag = 0; /* Not MOP V3 messages. */
int Not4Flag = 0; /* Not MOP V4 messages. */
int promisc = 1; /* Need promisc mode */
extern char *__progname; /* from crt0.o */
int
main(argc, argv)
int argc;
@@ -111,7 +109,7 @@ main(argc, argv)
}
if (VersionFlag) {
fprintf(stdout,"%s: version %s\n", __progname, version);
fprintf(stdout,"%s: version %s\n", getprogname(), version);
exit(0);
}
@@ -128,7 +126,7 @@ main(argc, argv)
if ((!ForegroundFlag) && DebugFlag)
fprintf(stdout,
"%s: not running as daemon, -d given.\n", __progname);
"%s: not running as daemon, -d given.\n", getprogname());
if ((!ForegroundFlag) && (!DebugFlag)) {
pid = fork();
@@ -146,7 +144,7 @@ main(argc, argv)
pidfile(NULL);
}
syslog(LOG_INFO, "%s %s started.", __progname, version);
syslog(LOG_INFO, "%s %s started.", getprogname(), version);
if (AllFlag)
deviceInitAll();
@@ -162,9 +160,9 @@ void
Usage()
{
(void) fprintf(stderr, "usage: %s -a [ -d -f -v ] [ -3 | -4 ]\n",
__progname);
getprogname());
(void) fprintf(stderr, " %s [ -d -f -v ] [ -3 | -4 ] interface\n",
__progname);
getprogname());
exit(1);
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: mopprobe.c,v 1.6 2001/01/11 01:42:50 lukem Exp $ */
/* $NetBSD: mopprobe.c,v 1.7 2001/02/19 23:22:45 cgd Exp $ */
/*
* Copyright (c) 1993-96 Mats O Jansson. All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: mopprobe.c,v 1.6 2001/01/11 01:42:50 lukem Exp $");
__RCSID("$NetBSD: mopprobe.c,v 1.7 2001/02/19 23:22:45 cgd Exp $");
#endif
/*
@@ -68,8 +68,6 @@ int Not4Flag = 0; /* Not MOP V4 messages */
int oflag = 0; /* print only once */
int promisc = 1; /* Need promisc mode */
extern char *__progname; /* from crt0.o */
int
main(argc, argv)
int argc;
@@ -125,8 +123,9 @@ main(argc, argv)
void
Usage()
{
(void) fprintf(stderr, "usage: %s -a [ -3 | -4 ]\n", __progname);
(void) fprintf(stderr, " %s [ -3 | -4 ] interface\n", __progname);
(void) fprintf(stderr, "usage: %s -a [ -3 | -4 ]\n", getprogname());
(void) fprintf(stderr, " %s [ -3 | -4 ] interface\n",
getprogname());
exit(1);
}

View File

@@ -1,4 +1,4 @@
/* $NetBSD: moptrace.c,v 1.6 2001/01/11 01:42:50 lukem Exp $ */
/* $NetBSD: moptrace.c,v 1.7 2001/02/19 23:22:45 cgd Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: moptrace.c,v 1.6 2001/01/11 01:42:50 lukem Exp $");
__RCSID("$NetBSD: moptrace.c,v 1.7 2001/02/19 23:22:45 cgd Exp $");
#endif
/*
@@ -67,8 +67,6 @@ int Not3Flag = 0; /* Ignore MOP V3 messages */
int Not4Flag = 0; /* Ignore MOP V4 messages */
int promisc = 1; /* Need promisc mode */
extern char *__progname; /* from crt0.o */
int
main(argc, argv)
int argc;
@@ -121,9 +119,10 @@ main(argc, argv)
void
Usage()
{
(void) fprintf(stderr, "usage: %s -a [ -d ] [ -3 | -4 ]\n", __progname);
(void) fprintf(stderr, "usage: %s -a [ -d ] [ -3 | -4 ]\n",
getprogname());
(void) fprintf(stderr, " %s [ -d ] [ -3 | -4 ] interface\n",
__progname);
getprogname());
exit(1);
}