summaryrefslogtreecommitdiffstats
path: root/toolbox
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2010-03-03 12:40:21 -0800
committerSan Mehat <san@google.com>2010-03-03 12:40:21 -0800
commit661aff600c5cb8e72aa2892a2a75ea6015bf1457 (patch)
tree1a02b978b8007e697dc7c2c607ddfa1fa647aa5d /toolbox
parent503df2075991cd03ddf43d14e05768a2138b9028 (diff)
downloadsystem_core-661aff600c5cb8e72aa2892a2a75ea6015bf1457.zip
system_core-661aff600c5cb8e72aa2892a2a75ea6015bf1457.tar.gz
system_core-661aff600c5cb8e72aa2892a2a75ea6015bf1457.tar.bz2
newfs_msdos: Allow -s option to work by itself
Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'toolbox')
-rw-r--r--toolbox/newfs_msdos.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toolbox/newfs_msdos.c b/toolbox/newfs_msdos.c
index 8e611c6..ff9e844 100644
--- a/toolbox/newfs_msdos.c
+++ b/toolbox/newfs_msdos.c
@@ -414,11 +414,14 @@ newfs_msdos_main(int argc, char *argv[])
if (!(opt_f || (opt_h && opt_u && opt_S && opt_s && oflag))) {
off_t delta;
getdiskinfo(fd, fname, dtype, oflag, &bpb);
+ if (opt_s) {
+ bpb.bsec = opt_s;
+ }
bpb.bsec -= (opt_ofs / bpb.bps);
delta = bpb.bsec % bpb.spt;
if (delta != 0) {
- warnx("trim %d sectors to adjust to a multiple of %d",
- (int)delta, bpb.spt);
+ warnx("trim %d sectors from %d to adjust to a multiple of %d",
+ (int)delta, bpb.bsec, bpb.spt);
bpb.bsec -= delta;
}
if (bpb.spc == 0) { /* set defaults */