diff options
author | Sami Kerola | 2016-07-04 23:09:10 +0200 |
---|---|---|
committer | Sami Kerola | 2016-07-21 22:14:33 +0200 |
commit | 74ce680a3ef90503b26da0a34f04cf725f6c5beb (patch) | |
tree | 307baa695e1c36c7a7855718468d9913ddf96bc1 /sys-utils/setpriv.c | |
parent | agetty: call uname() only when necessary (diff) | |
download | kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.gz kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.tar.xz kernel-qcow2-util-linux-74ce680a3ef90503b26da0a34f04cf725f6c5beb.zip |
misc: simplify if clauses [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/setpriv.c')
-rw-r--r-- | sys-utils/setpriv.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c index 163012223..3b99a177e 100644 --- a/sys-utils/setpriv.c +++ b/sys-utils/setpriv.c @@ -781,9 +781,8 @@ int main(int argc, char **argv) errx(EXIT_FAILURE, _("--[re]gid requires --keep-groups, --clear-groups, or --groups")); - if (opts.nnp) - if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1) - err(EXIT_FAILURE, _("disallow granting new privileges failed")); + if (opts.nnp && prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1) + err(EXIT_FAILURE, _("disallow granting new privileges failed")); if (opts.selinux_label) do_selinux_label(opts.selinux_label); @@ -820,9 +819,8 @@ int main(int argc, char **argv) err(SETPRIV_EXIT_PRIVERR, _("setgroups failed")); } - if (opts.have_securebits) - if (prctl(PR_SET_SECUREBITS, opts.securebits, 0, 0, 0) != 0) - err(SETPRIV_EXIT_PRIVERR, _("set process securebits failed")); + if (opts.have_securebits && prctl(PR_SET_SECUREBITS, opts.securebits, 0, 0, 0) != 0) + err(SETPRIV_EXIT_PRIVERR, _("set process securebits failed")); if (opts.bounding_set) { do_caps(CAPNG_BOUNDING_SET, opts.bounding_set); |