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
This commit is contained in:
Stefan Eßer 2024-06-04 08:26:09 +02:00
parent f1d73aacdc
commit 41ee91c64f

View file

@ -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) %