From: Wesley M Date: Tue, 15 Dec 2015 15:47:22 +0000 (-0500) Subject: Refactoring conditional directives. X-Git-Tag: lxc-2.0.0.beta1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=727c307376f4094f9f48cfd40f330944f3e400e4;p=thirdparty%2Flxc.git Refactoring conditional directives. Signed-off-by: Wesley Marques Acked-by: Stéphane Graber --- diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c index 5982cb475..451e31572 100644 --- a/src/lxc/seccomp.c +++ b/src/lxc/seccomp.c @@ -558,6 +558,7 @@ int lxc_read_seccomp_config(struct lxc_conf *conf) { FILE *f; int ret; + int check_seccomp_attr_set; if (!conf->seccomp) return 0; @@ -578,11 +579,12 @@ int lxc_read_seccomp_config(struct lxc_conf *conf) /* turn of no-new-privs. We don't want it in lxc, and it breaks * with apparmor */ - if (seccomp_attr_set( #if HAVE_SCMP_FILTER_CTX - conf->seccomp_ctx, + check_seccomp_attr_set = seccomp_attr_set(conf->seccomp_ctx, SCMP_FLTATR_CTL_NNP, 0); +#else + check_seccomp_attr_set = seccomp_attr_set(SCMP_FLTATR_CTL_NNP, 0); #endif - SCMP_FLTATR_CTL_NNP, 0)) { + if (check_seccomp_attr_set) { ERROR("failed to turn off n-new-privs"); return -1; }