aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/main.c b/main.c
index 09dbfbe2..a311eb93 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.259 2015/11/20 21:59:54 schwarze Exp $ */
+/* $Id: main.c,v 1.260 2015/12/15 17:38:45 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -299,8 +299,9 @@ main(int argc, char *argv[])
use_pager = 0;
#if HAVE_PLEDGE
- if (!use_pager && pledge("stdio rpath flock", NULL) == -1)
- err((int)MANDOCLEVEL_SYSERR, "pledge");
+ if (!use_pager)
+ if (pledge("stdio rpath flock", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
#endif
/* Parse arguments. */
@@ -430,9 +431,13 @@ main(int argc, char *argv[])
/* mandoc(1) */
#if HAVE_PLEDGE
- if (pledge(use_pager ? "stdio rpath tmppath tty proc exec" :
- "stdio rpath", NULL) == -1)
- err((int)MANDOCLEVEL_SYSERR, "pledge");
+ if (use_pager) {
+ if (pledge("stdio rpath tmppath tty proc exec", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
+ } else {
+ if (pledge("stdio rpath", NULL) == -1)
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
+ }
#endif
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths))