summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-06-29 17:05:42 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-06-29 17:05:42 +0000
commit9e371e057e22115c3bce464fe787d375ed2e33bd (patch)
treef8209c41bc4c5ce3af6caf86d2b8718241ccdd47 /usr.bin
parent17aa86b96b49cad1340f1511a65ee93e2ce36619 (diff)
use warx instea of fprintf
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ipcrm/ipcrm.c14
1 files changed, 8 insertions, 6 deletions
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);