From 4e066f7feda001f98884ee2a29647e44f3d45c4e Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 5 Dec 2017 14:03:11 +0900 Subject: [PATCH] bootspec: use blkid only if HAVE_BLKID is defined --- src/shared/bootspec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index aa722c304a0..0481293a50c 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) -- 2.47.3