summaryrefslogtreecommitdiff
path: root/usr.bin/arch/arch.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2015-09-25 16:19:27 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2015-09-25 16:19:27 +0000
commit4c8cb7b5da871475ec86e4e4dd214217aa055ee0 (patch)
tree363387838d5fcb08f2d8f2947440473655e00062 /usr.bin/arch/arch.c
parentb21fa697e1d225c59c11cbb005316b8805ff289f (diff)
tidy up a bit more
Diffstat (limited to 'usr.bin/arch/arch.c')
-rw-r--r--usr.bin/arch/arch.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/arch/arch.c b/usr.bin/arch/arch.c
index d4e90eb85d5..e5ae829ba72 100644
--- a/usr.bin/arch/arch.c
+++ b/usr.bin/arch/arch.c
@@ -31,7 +31,7 @@
#include <string.h>
#include <unistd.h>
-static void usage(void);
+static void __dead usage(void);
static int machine;
@@ -53,7 +53,7 @@ main(int argc, char *argv[])
arch = MACHINE_ARCH;
opts = "ks";
}
- while ((c = getopt(argc, argv, opts)) != -1)
+ while ((c = getopt(argc, argv, opts)) != -1) {
switch (c) {
case 'a':
arch = MACHINE_ARCH;
@@ -66,19 +66,16 @@ main(int argc, char *argv[])
break;
default:
usage();
- /* NOTREACHED */
}
- if (optind != argc) {
- usage();
- /* NOTREACHED */
}
- if (!short_form)
- fputs("OpenBSD.", stdout);
- puts(arch);
- return 0;
+ if (optind != argc)
+ usage();
+
+ printf("%s%s\n", short_form ? "" : "OpenBSD.", arch);
+ return (0);
}
-static void
+static void __dead
usage(void)
{
if (machine)