summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-11-06 17:23:50 +0000
committerschwarze <schwarze@openbsd.org>2015-11-06 17:23:50 +0000
commit81f22375423ab9d4e75ac5ead5c45f8cc58c0ce9 (patch)
tree1c8bd1be16623783eb616fdb4d8868aa356610fb
parentInstead of multiplying with 0..1, extend the bit into a mask and do an AND. (diff)
downloadwireguard-openbsd-81f22375423ab9d4e75ac5ead5c45f8cc58c0ce9.tar.xz
wireguard-openbsd-81f22375423ab9d4e75ac5ead5c45f8cc58c0ce9.zip
correct exit status on pledge(2) errors
-rw-r--r--usr.bin/mandoc/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index 81691364218..d18c61f6af3 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.162 2015/11/06 16:27:13 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.163 2015/11/06 17:23:50 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -128,7 +128,7 @@ main(int argc, char *argv[])
return mandocdb(argc, argv);
if (pledge("stdio rpath tmppath proc exec flock", NULL) == -1)
- err(1, "pledge");
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
/* Search options. */
@@ -270,7 +270,7 @@ main(int argc, char *argv[])
use_pager = 0;
if (!use_pager && pledge("stdio rpath flock", NULL) == -1)
- err(1, "pledge");
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
/* Parse arguments. */
@@ -389,7 +389,7 @@ main(int argc, char *argv[])
if (pledge(use_pager ? "stdio rpath tmppath proc exec" :
"stdio rpath", NULL) == -1)
- err(1, "pledge");
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
if (search.argmode == ARG_FILE && ! moptions(&options, auxpaths))
return (int)MANDOCLEVEL_BADARG;
@@ -978,7 +978,7 @@ spawn_pager(struct tag_files *tag_files)
break;
default:
if (pledge("stdio rpath tmppath", NULL) == -1)
- err(1, "pledge");
+ err((int)MANDOCLEVEL_SYSERR, "pledge");
return pager_pid;
}