use getprogname()

This commit is contained in:
cgd 2001-02-20 23:22:49 +00:00
parent e459adfd7a
commit d7666f6c7f
4 changed files with 16 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: test.c,v 1.2 2000/08/19 17:52:13 sommerfeld Exp $ */
/* $NetBSD: test.c,v 1.3 2001/02/20 23:22:49 cgd Exp $ */
/*
* Combined MD5/SHA1 time and regression test.
@ -17,11 +17,10 @@ int mflag, rflag, sflag, tflag;
static void
usage(void)
{
extern char *__progname;
(void)fprintf(stderr,
"Usage:\t%s -r[ms] < test-file\n"
"\t%s -t[ms]\n",
__progname, __progname);
getprogname(), getprogname());
exit(1);
/* NOTREACHED */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbrlabel.c,v 1.15 2001/02/18 03:36:07 lukem Exp $ */
/* $NetBSD: mbrlabel.c,v 1.16 2001/02/20 23:23:49 cgd Exp $ */
/*
* Copyright (C) 1998 Wolfgang Solfrank.
@ -33,7 +33,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: mbrlabel.c,v 1.15 2001/02/18 03:36:07 lukem Exp $");
__RCSID("$NetBSD: mbrlabel.c,v 1.16 2001/02/20 23:23:49 cgd Exp $");
#endif /* not lint */
#include <stdio.h>
@ -62,7 +62,6 @@ u_int16_t getshort(void *);
u_int32_t getlong(void *);
struct disklabel label;
extern char *__progname;
void
getlabel(int sd)
@ -258,7 +257,7 @@ getparts(int sd, u_int32_t off, u_int32_t extoff, int verbose)
void
usage(void)
{
fprintf(stderr, "Usage: %s [-fqrw] rawdisk\n", __progname);
fprintf(stderr, "Usage: %s [-fqrw] rawdisk\n", getprogname());
exit(1);
}

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.19 2001/02/04 20:12:32 christos Exp $
# $NetBSD: Makefile,v 1.20 2001/02/20 23:24:47 cgd Exp $
# @(#)Makefile 8.6 (Berkeley) 5/8/95
PROG= mount
@ -47,15 +47,13 @@ checkname.c: ${.CURDIR}/Makefile
done; \
echo "void checkname(int, char **);"; \
echo; \
echo "extern const char *__progname;"; \
echo; \
echo "void checkname(int argc, char **argv) {"; \
echo "if (strcmp(__progname, \"mount\") == 0) return;"; \
echo "if (strcmp(getprogname(), \"mount\") == 0) return;"; \
for p in ${MOUNT_PROGS}; do \
echo "if (strcmp(__progname, \"$$p\") == 0)"; \
echo "if (strcmp(getprogname(), \"$$p\") == 0)"; \
echo " exit($$p(argc, argv));"; \
done; \
echo "if (strcmp(__progname, \"mount_ufs\") == 0)"; \
echo "if (strcmp(getprogname(), \"mount_ufs\") == 0)"; \
echo " exit(mount_ffs(argc, argv));"; \
echo "}"; \
fi > ${.TARGET}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdogctl.c,v 1.6 2001/02/04 21:14:32 christos Exp $ */
/* $NetBSD: wdogctl.c,v 1.7 2001/02/20 23:25:29 cgd Exp $ */
/*-
* Copyright (c) 2000 Zembu Labs, Inc.
@ -59,8 +59,6 @@ void usage(void);
int Aflag;
extern const char *__progname;
int
main(int argc, char *argv[])
{
@ -345,10 +343,12 @@ list_timers(void)
void
usage(void)
{
fprintf(stderr, "Usage: %s\n", __progname);
fprintf(stderr, " %s -k [-A] [-p seconds] timer\n", __progname);
fprintf(stderr, " %s -u [-A] [-p seconds] timer\n", __progname);
fprintf(stderr, " %s -d\n", __progname);
fprintf(stderr, "Usage: %s\n", getprogname());
fprintf(stderr, " %s -k [-A] [-p seconds] timer\n",
getprogname());
fprintf(stderr, " %s -u [-A] [-p seconds] timer\n",
getprogname());
fprintf(stderr, " %s -d\n", getprogname());
exit(1);
}