From: Frantisek Sumsal Date: Wed, 25 Jan 2023 12:21:09 +0000 (+0100) Subject: partition: fix build with newer linux/btrfs.h uapi header X-Git-Tag: v253-rc2~66^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F26195%2Fhead;p=thirdparty%2Fsystemd.git partition: fix build with newer linux/btrfs.h uapi header linux/btrfs.h needs to be included after sys/mount.h, as since [0] linux/btrfs.h includes linux/fs.h causing build errors: ``` In file included from /usr/include/linux/fs.h:19, from ../src/basic/linux/btrfs.h:29, from ../src/partition/growfs.c:6: /usr/include/sys/mount.h:35:3: error: expected identifier before numeric constant 35 | MS_RDONLY = 1, /* Mount read-only. */ | ^~~~~~~~~ [1222/2169] Compiling C object systemd-creds.p/src_creds_creds.c.o ninja: build stopped: subcommand failed. ``` See: https://github.com/systemd/systemd/issues/8507 [0] https://github.com/torvalds/linux/commit/a28135303a669917002f569aecebd5758263e4aa --- diff --git a/src/partition/growfs.c b/src/partition/growfs.c index 248746f7247..62f3ee6744a 100644 --- a/src/partition/growfs.c +++ b/src/partition/growfs.c @@ -3,12 +3,17 @@ #include #include #include -#include #include #include #include #include #include +/* This needs to be included after sys/mount.h, as since [0] linux/btrfs.h + * includes linux/fs.h causing build errors + * See: https://github.com/systemd/systemd/issues/8507 + * [0] https://github.com/torvalds/linux/commit/a28135303a669917002f569aecebd5758263e4aa + */ +#include #include "sd-device.h"