summaryrefslogtreecommitdiff
path: root/usr.bin/uname
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-10-28 07:23:00 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-10-28 07:23:00 +0000
commite1eb93081c1a15355b195a51873d6f833e4d6fcc (patch)
tree0b541d83cf7ca112e060ac73fc158ecf71fccd2d /usr.bin/uname
parent1b87e303329de4689e89673013329a46d50ee901 (diff)
Delete some useless setlocale(3) calls in /usr/bin, no functional change.
Patches from Jan Stary <hans at stare dot cz>, tweaked by me and tb@. While here, apply some simple style improvements: Sort headers, static void __dead usage(), return from main(), zap case '?', drop /* NOTREACHED */, drop break after usage(), ... OK tb@ millert@
Diffstat (limited to 'usr.bin/uname')
-rw-r--r--usr.bin/uname/uname.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c
index d15c7c7fe2f..5f219d17d94 100644
--- a/usr.bin/uname/uname.c
+++ b/usr.bin/uname/uname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uname.c,v 1.18 2016/10/10 02:23:54 gsoares Exp $ */
+/* $OpenBSD: uname.c,v 1.19 2016/10/28 07:22:59 schwarze Exp $ */
/*
* Copyright (c) 1994 Winning Strategies, Inc.
@@ -35,12 +35,11 @@
#include <sys/utsname.h>
#include <err.h>
-#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-static void usage(void);
+static void __dead usage(void);
#define PRINT_SYSNAME 0x01
#define PRINT_NODENAME 0x02
@@ -58,8 +57,6 @@ main(int argc, char *argv[])
int space = 0;
int print_mask = 0;
- setlocale(LC_ALL, "");
-
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
@@ -88,18 +85,14 @@ main(int argc, char *argv[])
break;
default:
usage();
- /* NOTREACHED */
}
}
- if (optind != argc) {
+ if (optind != argc)
usage();
- /* NOTREACHED */
- }
- if (!print_mask) {
+ if (!print_mask)
print_mask = PRINT_SYSNAME;
- }
if (uname(&u) == -1)
err(1, NULL);
@@ -143,7 +136,7 @@ main(int argc, char *argv[])
return 0;
}
-static void
+static void __dead
usage(void)
{
fprintf(stderr, "usage: uname [-amnprsv]\n");