aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-05-19 17:49:23 +0200
committerDuncaen <mail@duncano.de>2017-05-19 17:49:23 +0200
commitd46b0d0ee8d95bb378598499cf7cac76fa5bca50 (patch)
treea2c8d41051b33fef5b7ebcb1a11cdea768000038
parent48df90e5bc696659a7ce2057943758eb7c28a093 (diff)
downloadlobase-d46b0d0ee8d95bb378598499cf7cac76fa5bca50.tar.gz
usr.bin/which: update to OPENBSD_6_1
-rw-r--r--usr.bin/which/which.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c
index dbd818c..c6bf35a 100644
--- a/usr.bin/which/which.c
+++ b/usr.bin/which/which.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: which.c,v 1.25 2016/01/14 22:02:13 millert Exp $ */
+/* $OpenBSD: which.c,v 1.26 2016/10/28 07:22:59 schwarze Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -23,13 +23,12 @@
#include <err.h>
#include <errno.h>
-#include <locale.h>
+#include <limits.h>
#include <paths.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <limits.h>
#define PROG_WHICH 1
#define PROG_WHEREIS 2
@@ -37,7 +36,7 @@
extern char *__progname;
int findprog(char *, char *, int, int);
-__dead void usage(void);
+static void __dead usage(void);
/*
* which(1) -- find an executable(s) in the user's path
@@ -56,8 +55,6 @@ main(int argc, char *argv[])
size_t n;
int ch, allmatches = 0, notfound = 0, progmode = PROG_WHICH;
- (void)setlocale(LC_ALL, "");
-
while ((ch = getopt(argc, argv, "a")) != -1)
switch (ch) {
case 'a':
@@ -93,7 +90,7 @@ main(int argc, char *argv[])
if (findprog(argv[n], path, progmode, allmatches) == 0)
notfound++;
- exit((notfound == 0) ? 0 : ((notfound == argc) ? 2 : 1));
+ return ((notfound == 0) ? 0 : ((notfound == argc) ? 2 : 1));
}
int
@@ -152,7 +149,7 @@ findprog(char *prog, char *path, int progmode, int allmatches)
return (rval);
}
-__dead void
+static void __dead
usage(void)
{
(void)fprintf(stderr, "usage: %s [-a] name ...\n", __progname);