summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Balsini <balsini@google.com>2021-02-17 09:25:44 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-02-17 09:25:44 +0000
commit8ef9d92197951184397517dee90d6398769c5c6f (patch)
tree885b8e876ede7b65d35f3b1c44372e970430ca47
parent08b0345a2db34946365d91937b892315001d99ca (diff)
parentee18a6bd9addbbac4d0413895ef134cceda3f58e (diff)
downloadnewfs_msdos-8ef9d92197951184397517dee90d6398769c5c6f.tar.gz
Fix expected BLKGETSIZE64 ioctl result type to 64 bit am: ee18a6bd9a
Original change: https://android-review.googlesource.com/c/platform/external/newfs_msdos/+/1588314 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I40e04f8127bd1f66065a1dc0bc39e978a8293bea
-rw-r--r--mkfs_msdos.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mkfs_msdos.c b/mkfs_msdos.c
index 08c435b..946096f 100644
--- a/mkfs_msdos.c
+++ b/mkfs_msdos.c
@@ -936,14 +936,14 @@ static int getdiskinfo(int fd, const char *fname, const char *dtype,
if (ckgeom(fname, bpb->bpbBytesPerSec, "bytes/sector") == -1) return -1;
- u_long device_size;
+ u_int64_t device_size;
if (ioctl(fd, BLKGETSIZE64, &device_size)) {
err(1, "ioctl(BLKGETSIZE64) failed");
}
- u_long sectors = device_size/bpb->bpbBytesPerSec;
- if (sectors > UINT32_MAX) {
- errx(1, "too many sectors: %lu (%lu byte device, %u bytes/sector)",
+ u_int64_t sectors = device_size/bpb->bpbBytesPerSec;
+ if (sectors > UINT_MAX) {
+ errx(1, "too many sectors: %"PRIu64" (%"PRIu64" byte device, %u bytes/sector)",
sectors, device_size, bpb->bpbBytesPerSec);
}
bpb->bpbHugeSectors = sectors;