Lines 402-416
Link Here
|
402 |
if (oflag) |
402 |
if (oflag) |
403 |
bpb.bpbHiddenSecs = opt_o; |
403 |
bpb.bpbHiddenSecs = opt_o; |
404 |
if (!(opt_f || (opt_h && opt_u && opt_S && opt_s && oflag))) { |
404 |
if (!(opt_f || (opt_h && opt_u && opt_S && opt_s && oflag))) { |
405 |
off_t delta; |
|
|
406 |
getdiskinfo(fd, fname, dtype, oflag, &bpb); |
405 |
getdiskinfo(fd, fname, dtype, oflag, &bpb); |
407 |
bpb.bpbHugeSectors -= (opt_ofs / bpb.bpbBytesPerSec); |
406 |
bpb.bpbHugeSectors -= (opt_ofs / bpb.bpbBytesPerSec); |
408 |
delta = bpb.bpbHugeSectors % bpb.bpbSecPerTrack; |
|
|
409 |
if (delta != 0) { |
410 |
warnx("trim %d sectors to adjust to a multiple of %d", |
411 |
(int)delta, bpb.bpbSecPerTrack); |
412 |
bpb.bpbHugeSectors -= delta; |
413 |
} |
414 |
if (bpb.bpbSecPerClust == 0) { /* set defaults */ |
407 |
if (bpb.bpbSecPerClust == 0) { /* set defaults */ |
415 |
if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ |
408 |
if (bpb.bpbHugeSectors <= 6000) /* about 3MB -> 512 bytes */ |
416 |
bpb.bpbSecPerClust = 1; |
409 |
bpb.bpbSecPerClust = 1; |