summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2017-08-02 14:38:08 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2017-08-06 13:08:34 +0900
commitecfbc84f1ca88d2aafd974ee13cdda87209c430b (patch)
tree0fe1d65f16b82d3052e62e5fba018674829bec69
parent21771f338d268e06dc9a10b9b08b14ff8217d4be (diff)
downloadsystemd-ecfbc84f1ca88d2aafd974ee13cdda87209c430b.tar.gz
systemd-ecfbc84f1ca88d2aafd974ee13cdda87209c430b.tar.bz2
systemd-ecfbc84f1ca88d2aafd974ee13cdda87209c430b.zip
core: define variables only when they are required
Follow-up for 7f18ef0a555a3c3cef08e0965dc453fe5954b5a7.
-rw-r--r--src/core/execute.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 2b6acb266a..56e3aa61ff 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2295,8 +2295,16 @@ static int exec_child(
const char *home = NULL, *shell = NULL;
dev_t journal_stream_dev = 0;
ino_t journal_stream_ino = 0;
- bool needs_exec_restrictions, needs_mount_namespace,
- needs_selinux = false, needs_smack = false, needs_apparmor = false;
+ bool needs_exec_restrictions, needs_mount_namespace;
+#ifdef HAVE_SELINUX
+ bool needs_selinux = false;
+#endif
+#ifdef HAVE_SMACK
+ bool needs_smack = false;
+#endif
+#ifdef HAVE_APPARMOR
+ bool needs_apparmor = false;
+#endif
uid_t uid = UID_INVALID;
gid_t gid = GID_INVALID;
int i, r, ngids = 0;