]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: define variables only when they are required
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 2 Aug 2017 05:38:08 +0000 (14:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 6 Aug 2017 04:08:34 +0000 (13:08 +0900)
Follow-up for 7f18ef0a555a3c3cef08e0965dc453fe5954b5a7.

src/core/execute.c

index 2b6acb266a10586fab7adf4857348aa6b3cfb2e2..56e3aa61ff559d2f331427ee2e598e94336dac82 100644 (file)
@@ -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;