diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-12-15 17:38:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-12-15 17:38:45 +0000 |
commit | f0d907b5ddcf8c6632e2f8c3301b9ef19abc0a02 (patch) | |
tree | ff9a80d2c3722497da3f61fc232083562c4f7945 /mandocdb.c | |
parent | cd024781e6da76dda541a980fc161f031b33e300 (diff) | |
download | mandoc-f0d907b5ddcf8c6632e2f8c3301b9ef19abc0a02.tar.gz |
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.
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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; |