From 9e371e057e22115c3bce464fe787d375ed2e33bd Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Tue, 29 Jun 2004 17:05:42 +0000 Subject: use warx instea of fprintf --- usr.bin/ipcrm/ipcrm.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/ipcrm/ipcrm.c b/usr.bin/ipcrm/ipcrm.c index fa579c190ef..2089190cfaf 100644 --- a/usr.bin/ipcrm/ipcrm.c +++ b/usr.bin/ipcrm/ipcrm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipcrm.c,v 1.6 2003/10/06 07:31:24 fgsch Exp $*/ +/* $OpenBSD: ipcrm.c,v 1.7 2004/06/29 17:05:41 mickey Exp $*/ /* * Copyright (c) 1994 Adam Glass @@ -59,8 +59,10 @@ void not_configured(int); void usage(void) { - fprintf(stderr, "usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]\n"); - fprintf(stderr, " [-Q msgkey] [-M shmkey] [-S semkey] ...]\n"); + extern char *__progname; + fprintf(stderr, "usage: %s [ [-q msqid] [-m shmid] [-s semid]\n" + " [-Q msgkey] [-M shmkey] [-S semkey] ...]\n", + __progname); exit(1); } @@ -161,16 +163,16 @@ main(int argc, char *argv[]) } break; case ':': - fprintf(stderr, "option -%c requires an argument\n", optopt); + warnx("option -%c requires an argument", optopt); usage(); default: - fprintf(stderr, "unrecognized option: -%c\n", optopt); + warnx("unrecognized option: -%c", optopt); usage(); } } if (optind != argc) { - fprintf(stderr, "unknown argument: %s\n", argv[optind]); + warnx("unknown argument: %s", argv[optind]); usage(); } exit(errflg); -- cgit v1.2.3