diff options
author | phk <phk@FreeBSD.org> | 2004-02-25 13:43:17 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-02-25 13:43:17 +0000 |
commit | 723f970b1f0f70fad78c2aaaa7f13f07d1c8a0ad (patch) | |
tree | 2ed5cebf2a0f5bdcfb20d2133c04a7a91f68c944 /usr.sbin/fdread/fdutil.c | |
parent | e6ece1379498e94ec583f1ea07f0b5b5892bd58f (diff) | |
download | FreeBSD-src-723f970b1f0f70fad78c2aaaa7f13f07d1c8a0ad.zip FreeBSD-src-723f970b1f0f70fad78c2aaaa7f13f07d1c8a0ad.tar.gz |
Set size field correctly, it is number of sectors on the device, not
number of 512 bytes sectors.
Recognize size == -1 as meaning "auto".
Diffstat (limited to 'usr.sbin/fdread/fdutil.c')
-rw-r--r-- | usr.sbin/fdread/fdutil.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/fdread/fdutil.c b/usr.sbin/fdread/fdutil.c index 9990790..9b81cad 100644 --- a/usr.sbin/fdread/fdutil.c +++ b/usr.sbin/fdread/fdutil.c @@ -85,6 +85,8 @@ printstatus(struct fdc_status *fdcsp, int terse) fputs(msgbuf, stderr); } +static struct fd_type fd_types_auto[1]; + static struct fd_type fd_types_288m[] = { #if 0 @@ -321,8 +323,7 @@ parse_fmt(const char *s, enum fd_drivetype type, free(s1); } - out->size = out->tracks * out->heads * out->sectrac * - (128 << out->secsize) / 512; + out->size = out->tracks * out->heads * out->sectrac; } /* @@ -398,6 +399,9 @@ get_fmt(int size, enum fd_drivetype type) break; } + if (size == -1) + return fd_types_auto; + for (i = 0; i < n; i++, fdtp++) if (fdtp->size / 2 == size) return (fdtp); |