diff options
author | Fabrice Fontaine <fontaine.fabrice@gmail.com> | 2020-08-29 23:17:18 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2020-09-20 12:39:57 +0200 |
commit | 02bba02fa699732881d4ac771dc5b11c00ec459c (patch) | |
tree | 97d726767b6d6364c18c2d68109532f153169ee0 | |
parent | 13cb5986312bf877dd301087f72c13e4b4a620f9 (diff) | |
download | systemd-02bba02fa699732881d4ac771dc5b11c00ec459c.tar.gz |
src/shared/dissect-image.c: fix build without blkdid (#16901)
N_DEVICE_NODE_LIST_ATTEMPTS is unconditionally used since version 246 and
https://github.com/systemd/systemd/commit/ac1f3ad05f7476ae58981dcba45dfeb2c0006824
However, this variable is only defined if HAVE_BLKID is set resulting in
the following build failure if cryptsetup is enabled but not libblkid:
../src/shared/dissect-image.c:1336:34: error: 'N_DEVICE_NODE_LIST_ATTEMPTS' undeclared (first use in this function)
1336 | for (unsigned i = 0; i < N_DEVICE_NODE_LIST_ATTEMPTS; i++) {
|
Fixes:
- http://autobuild.buildroot.org/results/67782c225c08387c1bbcbea9eee3ca12bc6577cd
(cherry picked from commit 28e2641a1aa506c5df93c7a0cb107aed8297b45e)
(cherry picked from commit d6b1e659b366283fe7c7961c3d1e1550c6b1b1eb)
(cherry picked from commit 2cba282b0c0d0cae7903f9953220efe798f5c7ec)
-rw-r--r-- | src/shared/dissect-image.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index c010fcf64a..e1fcb371c1 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -46,6 +46,9 @@ #include "user-util.h" #include "xattr-util.h" +/* how many times to wait for the device nodes to appear */ +#define N_DEVICE_NODE_LIST_ATTEMPTS 10 + int probe_filesystem(const char *node, char **ret_fstype) { /* Try to find device content type and return it in *ret_fstype. If nothing is found, * 0/NULL will be returned. -EUCLEAN will be returned for ambiguous results, and an @@ -147,9 +150,6 @@ static int enumerator_for_parent(sd_device *d, sd_device_enumerator **ret) { return 0; } -/* how many times to wait for the device nodes to appear */ -#define N_DEVICE_NODE_LIST_ATTEMPTS 10 - static int wait_for_partitions_to_appear( int fd, sd_device *d, |