summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-11 02:52:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2015-11-11 02:52:47 +0000
commitfe9e8af8f3246e14a9eb585feb4d7f5aaa093855 (patch)
tree3281fbb5b5f5de11321c6825dd5a2c6d70e07068 /bin
parent0edf0956a8620a9cd461d3f081c92645c20c8b9e (diff)
exit() after perror() for pledge failure. Perhaps this got introduced
as a test idiom, either when pledge was young or during the transition to strings.... dunno
Diffstat (limited to 'bin')
-rw-r--r--bin/csh/csh.c6
-rw-r--r--bin/ksh/main.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index 4d9001a47dd..09a34859054 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: csh.c,v 1.35 2015/10/28 22:18:53 naddy Exp $ */
+/* $OpenBSD: csh.c,v 1.36 2015/11/11 02:52:46 deraadt Exp $ */
/* $NetBSD: csh.c,v 1.14 1995/04/29 23:21:28 mycroft Exp $ */
/*-
@@ -152,8 +152,10 @@ main(int argc, char *argv[])
(void) time(&chktim);
if (pledge("stdio rpath wpath cpath fattr getpw proc exec tty",
- NULL) == -1)
+ NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
/*
* Move the descriptors to safe places. The variable didfds is 0 while we
diff --git a/bin/ksh/main.c b/bin/ksh/main.c
index 301f6666de2..ea2e6714e1b 100644
--- a/bin/ksh/main.c
+++ b/bin/ksh/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.73 2015/11/01 15:38:53 mmcc Exp $ */
+/* $OpenBSD: main.c,v 1.74 2015/11/11 02:52:46 deraadt Exp $ */
/*
* startup, main loop, environments and error handling
@@ -151,8 +151,10 @@ main(int argc, char *argv[])
#ifndef MKNOD
if (pledge("stdio rpath wpath cpath fattr flock getpw proc exec tty",
- NULL) == -1)
+ NULL) == -1) {
perror("pledge");
+ exit(1);
+ }
#endif
ainit(&aperm); /* initialize permanent Area */