src/shared/dissect-image.c: fix build without blkdid (#16901)
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 29 Aug 2020 21:17:18 +0000 (23:17 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 20 Sep 2020 10:50:35 +0000 (12:50 +0200)
commitfe1457a878a9b8c170406cb2132a830b8abd6af3
treef0381d69f6283515d5cc2ad0bbc6e8b17d74cd26
parent741c8b763a9fbb1dc7ff4997302564637be4abc6
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)
(cherry picked from commit 02bba02fa699732881d4ac771dc5b11c00ec459c)
src/shared/dissect-image.c