summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-06-20 13:33:22 -0700
committerElliott Hughes <enh@google.com>2018-06-20 13:33:22 -0700
commit188c86eb2447174d47c30be090b67a40857b3441 (patch)
treed7aef744e3cb4428dd9081c589259c83711123c1
parent5946c623c54423d7eee305902e1532e8753f7c31 (diff)
downloadnewfs_msdos-android-p-preview-4.tar.gz
Remove failing HDIO_GETGEO ioctl.android-p-preview-5android-p-preview-4
This was copied across from the toolbox code, but it's outlived its usefulness: the ioctl is failing all the time now because we're acting on a partition rather than the underlying block device. Bug: http://b/29899852 Test: adb shell sm set-virtual-disk true Change-Id: I7f77e342e226b40ded1155f3e320b2604b4c0404
-rw-r--r--mkfs_msdos.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/mkfs_msdos.c b/mkfs_msdos.c
index 350b782..04afc84 100644
--- a/mkfs_msdos.c
+++ b/mkfs_msdos.c
@@ -852,27 +852,10 @@ static int getdiskinfo(int fd, const char *fname, const char *dtype,
bpb->bpbHugeSectors = (u_int)block_size;
- struct hd_geometry geom;
- if (ioctl(fd, HDIO_GETGEO, &geom)) {
- warn("ioctl(HDIO_GETGEO) failed, but will use sane values");
- geom.heads = 64;
- geom.sectors = 63;
- }
-
- if (!geom.heads) {
- warnx("Bogus heads from kernel - setting sane value");
- geom.heads = 64;
- }
-
- if (!geom.sectors) {
- warnx("Bogus sectors from kernel - setting sane value");
- geom.sectors = 63;
- }
-
- bpb->bpbSecPerTrack = geom.sectors;
+ bpb->bpbSecPerTrack = 63;
if (ckgeom(fname, bpb->bpbSecPerTrack, "sectors/track") == -1) return -1;
- bpb->bpbHeads = geom.heads;
+ bpb->bpbHeads = 64;
if (ckgeom(fname, bpb->bpbHeads, "drive heads") == -1) return -1;
return 0;