summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleydson Soares <gsoares@cvs.openbsd.org>2015-12-29 19:04:47 +0000
committerGleydson Soares <gsoares@cvs.openbsd.org>2015-12-29 19:04:47 +0000
commit9a7ad9bc671dfac4e4bff7b42c15771dfebe74e0 (patch)
tree986bfd621400a7e24a44a7b54c9c2875af099442
parentfa9be73bc12da2e753d60deda85fd4d5088dfe8d (diff)
fix exit status on pledge(2) failure.
OK tb@ jsg@
-rw-r--r--usr.bin/biff/biff.c4
-rw-r--r--usr.bin/cmp/cmp.c6
-rw-r--r--usr.bin/diff/diff.c4
-rw-r--r--usr.bin/make/main.c4
-rw-r--r--usr.bin/patch/patch.c4
-rw-r--r--usr.bin/sdiff/sdiff.c4
-rw-r--r--usr.bin/which/which.c4
7 files changed, 15 insertions, 15 deletions
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index cecd5e2f25e..382124ab2ce 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biff.c,v 1.13 2015/10/12 20:03:24 deraadt Exp $ */
+/* $OpenBSD: biff.c,v 1.14 2015/12/29 19:04:46 gsoares Exp $ */
/* $NetBSD: biff.c,v 1.3 1995/03/26 02:34:22 glass Exp $ */
/*
@@ -50,7 +50,7 @@ main(int argc, char *argv[])
char *name;
if (pledge("stdio rpath fattr", NULL) == -1)
- err(1, "pledge");
+ err(2, "pledge");
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
diff --git a/usr.bin/cmp/cmp.c b/usr.bin/cmp/cmp.c
index 0b5c86345a1..82a9c4b898f 100644
--- a/usr.bin/cmp/cmp.c
+++ b/usr.bin/cmp/cmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmp.c,v 1.13 2015/10/10 05:35:22 doug Exp $ */
+/* $OpenBSD: cmp.c,v 1.14 2015/12/29 19:04:46 gsoares Exp $ */
/* $NetBSD: cmp.c,v 1.7 1995/09/08 03:22:56 tls Exp $ */
/*
@@ -58,7 +58,7 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
if (pledge("stdio rpath", NULL) == -1)
- err(1, "pledge");
+ err(ERR_EXIT, "pledge");
while ((ch = getopt(argc, argv, "ls")) != -1)
switch (ch) {
@@ -113,7 +113,7 @@ main(int argc, char *argv[])
}
if (pledge("stdio", NULL) == -1)
- err(1, "pledge");
+ err(ERR_EXIT, "pledge");
skip1 = argc > 2 ? strtoq(argv[2], NULL, 0) : 0;
skip2 = argc == 4 ? strtoq(argv[3], NULL, 0) : 0;
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
index 3c73530892c..2b075f12c49 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diff.c,v 1.64 2015/10/26 12:52:27 tedu Exp $ */
+/* $OpenBSD: diff.c,v 1.65 2015/12/29 19:04:46 gsoares Exp $ */
/*
* Copyright (c) 2003 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -212,7 +212,7 @@ main(int argc, char **argv)
argv += optind;
if (pledge("stdio rpath tmppath", NULL) == -1)
- err(1, "pledge");
+ err(2, "pledge");
/*
* Do sanity checks, fill in stb1 and stb2 and call the appropriate
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 6c005df5db0..b1152e3f460 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.117 2015/11/29 09:17:12 espie Exp $ */
+/* $OpenBSD: main.c,v 1.118 2015/12/29 19:04:46 gsoares Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -191,7 +191,7 @@ MainParseArgs(int argc, char **argv)
#define OPTLETTERS "BSiknpqrst"
if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1)
- err(1, "pledge");
+ err(2, "pledge");
optind = 1; /* since we're called more than once */
optreset = 1;
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
index 63df8d43218..2011fbd42f8 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: patch.c,v 1.61 2015/11/11 02:52:46 deraadt Exp $ */
+/* $OpenBSD: patch.c,v 1.62 2015/12/29 19:04:46 gsoares Exp $ */
/*
* patch - a program to apply diffs to original files
@@ -150,7 +150,7 @@ main(int argc, char *argv[])
if (pledge("stdio rpath wpath cpath tmppath fattr", NULL) == -1) {
perror("pledge");
- exit(1);
+ my_exit(2);
}
setvbuf(stdout, NULL, _IOLBF, 0);
diff --git a/usr.bin/sdiff/sdiff.c b/usr.bin/sdiff/sdiff.c
index 0f70309a320..59f9515a9db 100644
--- a/usr.bin/sdiff/sdiff.c
+++ b/usr.bin/sdiff/sdiff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdiff.c,v 1.35 2015/10/18 04:18:41 deraadt Exp $ */
+/* $OpenBSD: sdiff.c,v 1.36 2015/12/29 19:04:46 gsoares Exp $ */
/*
* Written by Raymond Lai <ray@cyth.net>.
@@ -165,7 +165,7 @@ main(int argc, char **argv)
*tmp1, *tmp2, *s1, *s2;
if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1)
- err(1, "pledge");
+ err(2, "pledge");
/*
* Process diff flags.
diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c
index 3281a78c6d9..8aa6428f78a 100644
--- a/usr.bin/which/which.c
+++ b/usr.bin/which/which.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: which.c,v 1.21 2015/10/10 19:02:19 deraadt Exp $ */
+/* $OpenBSD: which.c,v 1.22 2015/12/29 19:04:46 gsoares Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
err(1, "Can't set uid to %u", geteuid());
if (pledge("stdio rpath", NULL) == -1)
- err(1, "pledge");
+ err(2, "pledge");
for (n = 0; n < argc; n++)
if (findprog(argv[n], path, progmode, allmatches) == 0)