summaryrefslogtreecommitdiff
path: root/usr.bin/dirname/dirname.c
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/dirname/dirname.c
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/dirname/dirname.c')
-rw-r--r--usr.bin/dirname/dirname.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/usr.bin/dirname/dirname.c b/usr.bin/dirname/dirname.c
index 7e0328e6f86..01dbea472f2 100644
--- a/usr.bin/dirname/dirname.c
+++ b/usr.bin/dirname/dirname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dirname.c,v 1.15 2015/10/09 01:37:07 deraadt Exp $ */
+/* $OpenBSD: dirname.c,v 1.16 2016/10/28 07:22:59 schwarze Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -18,12 +18,11 @@
#include <err.h>
#include <libgen.h>
-#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-void usage(void);
+static void __dead usage(void);
int
main(int argc, char *argv[])
@@ -31,8 +30,6 @@ main(int argc, char *argv[])
int ch;
char *dir;
- setlocale(LC_ALL, "");
-
if (pledge("stdio", NULL) == -1)
err(1, "pledge");
@@ -51,12 +48,12 @@ main(int argc, char *argv[])
if ((dir = dirname(argv[0])) == NULL)
err(1, "%s", argv[0]);
puts(dir);
- exit(0);
+ return 0;
}
extern char *__progname;
-void
+static void __dead
usage(void)
{
(void)fprintf(stderr, "usage: %s pathname\n", __progname);