summaryrefslogtreecommitdiffstats
path: root/sys-utils/unshare.c
diff options
context:
space:
mode:
authorKarel Zak2017-10-23 13:19:59 +0200
committerKarel Zak2017-10-23 13:19:59 +0200
commit525a0ab2f54208bc680b5629bfcd27debb03a986 (patch)
tree807da71fec02ed26b2dd283f7a96d642b43696e1 /sys-utils/unshare.c
parentlib/signames: remove signame array from header file (diff)
downloadkernel-qcow2-util-linux-525a0ab2f54208bc680b5629bfcd27debb03a986.tar.gz
kernel-qcow2-util-linux-525a0ab2f54208bc680b5629bfcd27debb03a986.tar.xz
kernel-qcow2-util-linux-525a0ab2f54208bc680b5629bfcd27debb03a986.zip
unshare: cleanup if-if code
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/unshare.c')
-rw-r--r--sys-utils/unshare.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys-utils/unshare.c b/sys-utils/unshare.c
index 00afc7dd8..f26b148f7 100644
--- a/sys-utils/unshare.c
+++ b/sys-utils/unshare.c
@@ -446,9 +446,8 @@ int main(int argc, char *argv[])
}
}
- if (kill_child_signo != 0)
- if (prctl(PR_SET_PDEATHSIG, kill_child_signo) < 0)
- err(EXIT_FAILURE, "prctl failed");
+ if (kill_child_signo != 0 && prctl(PR_SET_PDEATHSIG, kill_child_signo) < 0)
+ err(EXIT_FAILURE, "prctl failed");
if (maproot) {
if (setgrpcmd == SETGROUPS_ALLOW)