From: asavah Date: Mon, 4 Dec 2017 01:31:04 +0000 (+0200) Subject: growfs: fix building without libcrypsetup (#7535) X-Git-Tag: v236~74 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80088c7effc3bf74aca35302f5afd9a37d6dbfcf;p=platform%2Fupstream%2Fsystemd.git growfs: fix building without libcrypsetup (#7535) --- diff --git a/src/partition/growfs.c b/src/partition/growfs.c index 8b44c1d..901b33e 100644 --- a/src/partition/growfs.c +++ b/src/partition/growfs.c @@ -83,6 +83,7 @@ static int resize_btrfs(const char *path, int mountfd, int devfd, uint64_t numbl return 0; } +#if HAVE_LIBCRYPTSETUP static int resize_crypt_luks_device(dev_t devno, const char *fstype, dev_t main_devno) { char devpath[DEV_NUM_PATH_MAX], main_devpath[DEV_NUM_PATH_MAX]; _cleanup_close_ int main_devfd = -1; @@ -127,6 +128,7 @@ static int resize_crypt_luks_device(dev_t devno, const char *fstype, dev_t main_ return 1; } +#endif static int maybe_resize_slave_device(const char *mountpath, dev_t main_devno) { dev_t devno; @@ -134,8 +136,10 @@ static int maybe_resize_slave_device(const char *mountpath, dev_t main_devno) { _cleanup_free_ char *fstype = NULL; int r; +#if HAVE_LIBCRYPTSETUP crypt_set_log_callback(NULL, cryptsetup_log_glue, NULL); crypt_set_debug_level(1); +#endif r = get_block_device_harder(mountpath, &devno); if (r < 0) @@ -156,8 +160,10 @@ static int maybe_resize_slave_device(const char *mountpath, dev_t main_devno) { if (r < 0) return log_warning_errno(r, "Failed to probe \"%s\": %m", devpath); +#if HAVE_LIBCRYPTSETUP if (streq_ptr(fstype, "crypto_LUKS")) return resize_crypt_luks_device(devno, fstype, main_devno); +#endif log_debug("Don't know how to resize %s of type %s, ignoring", devpath, strnull(fstype)); return 0;