From ca35b64c186e9f750585635c5a31090aa82976c9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 15 Dec 2015 17:38:45 +0000 Subject: pledge(2) style: Make sure to always use the idiom 'if (pledge("' such that it can easily be searched for. No functional change. Requested by deraadt@ some time ago. --- mandocdb.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'mandocdb.c') diff --git a/mandocdb.c b/mandocdb.c index 8b45083c..04ba1acf 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.209 2015/11/07 17:58:55 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.210 2015/12/15 17:38:45 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze @@ -420,9 +420,11 @@ mandocdb(int argc, char *argv[]) argv += optind; #if HAVE_PLEDGE - if (nodb && pledge("stdio rpath", NULL) == -1) { - perror("pledge"); - return (int)MANDOCLEVEL_SYSERR; + if (nodb) { + if (pledge("stdio rpath", NULL) == -1) { + perror("pledge"); + return (int)MANDOCLEVEL_SYSERR; + } } #endif @@ -452,11 +454,12 @@ mandocdb(int argc, char *argv[]) * all files specified on the command-line. */ #if HAVE_PLEDGE - if (!nodb && pledge("stdio rpath wpath cpath fattr flock", - NULL) == -1) { - perror("pledge"); - exitcode = (int)MANDOCLEVEL_SYSERR; - goto out; + if (!nodb) { + if (pledge("stdio rpath wpath cpath fattr flock", NULL) == -1) { + perror("pledge"); + exitcode = (int)MANDOCLEVEL_SYSERR; + goto out; + } } #endif use_all = 1; -- cgit v1.2.3