diff options
author | stas <stas@FreeBSD.org> | 2013-05-05 08:00:16 +0000 |
---|---|---|
committer | stas <stas@FreeBSD.org> | 2013-05-05 08:00:16 +0000 |
commit | f6095fb25a03adbe42501dd5a42c59fd3d6992ba (patch) | |
tree | 6581ca74e149f71e5fa3a546a75f85986f5b5056 /sys/geom | |
parent | 3aa8c3c45d1e3a051472f5709b73c3f14dead8c9 (diff) | |
download | FreeBSD-src-f6095fb25a03adbe42501dd5a42c59fd3d6992ba.zip FreeBSD-src-f6095fb25a03adbe42501dd5a42c59fd3d6992ba.tar.gz |
- Use int8_t type for the mftrecsz field in g_label_ntfs. char type
used previously caused probe failure on platforms where char is unsigned
(e.g. ARM), as mftrecsz can be negative.
Submitted by: Ilya Bakulin <ilya@bakulin.de>
MFC after: 2 weeks
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/label/g_label_ntfs.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index e2c84cd..9c8d452 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -86,7 +86,7 @@ struct ntfs_bootfile { uint64_t bf_spv; uint64_t bf_mftcn; uint64_t bf_mftmirrcn; - uint8_t bf_mftrecsz; + int8_t bf_mftrecsz; uint32_t bf_ibsz; uint32_t bf_volsn; } __packed; @@ -100,7 +100,8 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) struct ntfs_attr *atr; off_t voloff; char *filerecp, *ap; - char mftrecsz, vnchar; + int8_t mftrecsz; + char vnchar; int recsize, j; g_topology_assert_not(); @@ -113,7 +114,7 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto done; - mftrecsz = (char)bf->bf_mftrecsz; + mftrecsz = bf->bf_mftrecsz; recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); if (recsize == 0 || recsize % pp->sectorsize != 0) goto done; |