mirror of
https://github.com/opnsense/src.git
synced 2026-06-05 06:42:56 -04:00
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:
parent
f1d73aacdc
commit
41ee91c64f
1 changed files with 4 additions and 0 deletions
|
|
@ -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) %
|
||||
|
|
|
|||
Loading…
Reference in a new issue