summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-12-05 12:13:17 +0100
committerGitHub <noreply@github.com>2017-12-05 12:13:17 +0100
commit3aa6a559040dda5f5db061d77ef5c5aaf3b33501 (patch)
tree5529750b2c8d0c1df34742c2787ffe63b3b265ab
parentea55e886a8eee45275fdd58263b4a2fb45efd02b (diff)
parenta28b9567321972b0cfc5babb0acc83f8b3cdb5d2 (diff)
downloadsystemd-3aa6a559040dda5f5db061d77ef5c5aaf3b33501.tar.gz
Merge pull request #7542 from yuwata/build-cleanup
several build cleanups
-rw-r--r--meson.build4
-rw-r--r--src/core/execute.c5
-rw-r--r--src/shared/bootspec.c8
-rw-r--r--src/test/meson.build3
4 files changed, 14 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index e0e8178910..edfa02afbb 100644
--- a/meson.build
+++ b/meson.build
@@ -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)
diff --git a/src/core/execute.c b/src/core/execute.c
index 59a8d60fe3..62f8ca7731 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -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
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
index aa722c304a..0481293a50 100644
--- a/src/shared/bootspec.c
+++ b/src/shared/bootspec.c
@@ -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)
diff --git a/src/test/meson.build b/src/test/meson.build
index efaa259d76..327c2859e8 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -155,7 +155,8 @@ tests += [
[['src/test/test-async.c'],
[],
- []],
+ [],
+ '', 'timeout=120'],
[['src/test/test-locale-util.c'],
[],