From 41ee91c64f47faaa8131df3cd8a63bdb60fa486a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Tue, 4 Jun 2024 08:26:09 +0200 Subject: [PATCH] newfs_msdos: fix build on non-FreeBSD systems Disable data area alignment if the build environment does not define PAGE_SIZE (e.g., when building on Linux or macOS). Reported by: jrtc27 MFC after: 1 week --- sbin/newfs_msdos/mkfs_msdos.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msdos.c index 423fbbcadcc..1bca560a59e 100644 --- a/sbin/newfs_msdos/mkfs_msdos.c +++ b/sbin/newfs_msdos/mkfs_msdos.c @@ -571,7 +571,11 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op) if (o.align) alignto = bpb.bpbSecPerClust; else +#ifdef PAGE_SIZE alignto = PAGE_SIZE / bpb.bpbBytesPerSec; +#else + alignto = 1; +#endif if (alignto > 1) { /* align data clusters */ alignment = (bpb.bpbResSectors + bpb.bpbBigFATsecs * bpb.bpbFATs + rds) %