]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #7542 from yuwata/build-cleanup
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Dec 2017 11:13:17 +0000 (12:13 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Dec 2017 11:13:17 +0000 (12:13 +0100)
several build cleanups

meson.build
src/core/execute.c
src/shared/bootspec.c
src/test/meson.build

index e0e8178910f6518b8bd54094340eb960d737cb6d..edfa02afbb46574562c4432ed15cb2b1c816894a 100644 (file)
@@ -635,9 +635,9 @@ substs.set('TTY_GID', tty_gid)
 
 # Ensure provided GID argument is numeric, otherwise fallback to default assignment
 if get_option('users-gid') != ''
-    users_gid = get_option('users-gid').to_int()
+        users_gid = get_option('users-gid').to_int()
 else
-    users_gid = '-'
+        users_gid = '-'
 endif
 substs.set('USERS_GID', users_gid)
 
index 59a8d60fe3e38df7e52d2e5fad162bf871610df5..62f8ca7731af8a1840974e469230b49ae6736fd8 100644 (file)
@@ -2146,6 +2146,7 @@ fail:
         return r;
 }
 
+#if ENABLE_SMACK
 static int setup_smack(
                 const ExecContext *context,
                 const ExecCommand *command) {
@@ -2176,6 +2177,7 @@ static int setup_smack(
 
         return 0;
 }
+#endif
 
 static int compile_bind_mounts(
                 const ExecContext *context,
@@ -2733,7 +2735,7 @@ static int exec_child(
                 int *exit_status) {
 
         _cleanup_strv_free_ char **our_env = NULL, **pass_env = NULL, **accum_env = NULL, **final_argv = NULL;
-        _cleanup_free_ char *mac_selinux_context_net = NULL, *home_buffer = NULL;
+        _cleanup_free_ char *home_buffer = NULL;
         _cleanup_free_ gid_t *supplementary_gids = NULL;
         const char *username = NULL, *groupname = NULL;
         const char *home = NULL, *shell = NULL;
@@ -2744,6 +2746,7 @@ static int exec_child(
                 needs_mount_namespace,  /* Do we need to set up a mount namespace for this kernel? */
                 needs_ambient_hack;     /* Do we need to apply the ambient capabilities hack? */
 #if HAVE_SELINUX
+        _cleanup_free_ char *mac_selinux_context_net = NULL;
         bool use_selinux = false;
 #endif
 #if ENABLE_SMACK
index aa722c304a08fe1b60e467db30bf55078ebb6286..0481293a50c14abb7f5c1717321da03ffd11d53f 100644 (file)
@@ -419,12 +419,14 @@ static int verify_esp(
                 uint64_t *ret_pstart,
                 uint64_t *ret_psize,
                 sd_id128_t *ret_uuid) {
-
+#if HAVE_BLKID
         _cleanup_blkid_free_probe_ blkid_probe b = NULL;
         char t[DEV_NUM_PATH_MAX];
+        const char *v;
+#endif
         uint64_t pstart = 0, psize = 0;
         struct stat st, st2;
-        const char *v, *t2;
+        const char *t2;
         struct statfs sfs;
         sd_id128_t uuid = SD_ID128_NULL;
         uint32_t part = 0;
@@ -479,6 +481,7 @@ static int verify_esp(
         if (detect_container() > 0 || geteuid() != 0)
                 goto finish;
 
+#if HAVE_BLKID
         xsprintf_dev_num_path(t, "block", st.st_dev);
         errno = 0;
         b = blkid_new_probe_from_filename(t);
@@ -561,6 +564,7 @@ static int verify_esp(
         r = safe_atou64(v, &psize);
         if (r < 0)
                 return log_error_errno(r, "Failed to parse PART_ENTRY_SIZE field.");
+#endif
 
 finish:
         if (ret_part)
index efaa259d763bc567cde11fd99e8e1364466be344..327c2859e8592799cf5ce21de65b9c4102144c6c 100644 (file)
@@ -155,7 +155,8 @@ tests += [
 
         [['src/test/test-async.c'],
          [],
-         []],
+         [],
+         '', 'timeout=120'],
 
         [['src/test/test-locale-util.c'],
          [],