summaryrefslogtreecommitdiffstats
path: root/sbin/newfs_msdos
diff options
context:
space:
mode:
authorsjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
committersjg <sjg@FreeBSD.org>2015-05-27 01:19:58 +0000
commit65145fa4c81da358fcbc3b650156dab705dfa34e (patch)
tree55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /sbin/newfs_msdos
parent60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff)
parente6b664c390af88d4a87208bc042ce503da664c3b (diff)
downloadFreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip
FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz
Merge sync of head
Diffstat (limited to 'sbin/newfs_msdos')
-rw-r--r--sbin/newfs_msdos/newfs_msdos.84
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c38
2 files changed, 20 insertions, 22 deletions
diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8
index d61043a..0f1abb4 100644
--- a/sbin/newfs_msdos/newfs_msdos.8
+++ b/sbin/newfs_msdos/newfs_msdos.8
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 1, 2013
+.Dd April 9, 2015
.Dt NEWFS_MSDOS 8
.Os
.Sh NAME
@@ -112,7 +112,7 @@ only those characters permitted in regular DOS (8+3) filenames.
.It Fl O Ar OEM
OEM string (up to 8 characters).
The default is
-.Qq Li "BSD 4.4" .
+.Qq Li "BSD4.4 " .
.It Fl S Ar sector-size
Number of bytes per sector.
Acceptable values are powers of 2
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index f315d98..4685782 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -829,28 +829,26 @@ getdiskinfo(int fd, const char *fname, const char *dtype, __unused int oflag,
if (lp == NULL) {
if (bpb->bpbBytesPerSec)
dlp.d_secsize = bpb->bpbBytesPerSec;
- if (ioctl(fd, DIOCGDINFO, &dlp) == -1) {
- if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE,
- &dlp.d_secsize) == -1)
- err(1, "cannot get sector size");
+ if (bpb->bpbBytesPerSec == 0 && ioctl(fd, DIOCGSECTORSIZE,
+ &dlp.d_secsize) == -1)
+ err(1, "cannot get sector size");
- dlp.d_secperunit = ms / dlp.d_secsize;
+ dlp.d_secperunit = ms / dlp.d_secsize;
- if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS,
- &dlp.d_nsectors) == -1) {
- warn("cannot get number of sectors per track");
- dlp.d_nsectors = 63;
- }
- if (bpb->bpbHeads == 0 &&
- ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) {
- warn("cannot get number of heads");
- if (dlp.d_secperunit <= 63*1*1024)
- dlp.d_ntracks = 1;
- else if (dlp.d_secperunit <= 63*16*1024)
- dlp.d_ntracks = 16;
- else
- dlp.d_ntracks = 255;
- }
+ if (bpb->bpbSecPerTrack == 0 && ioctl(fd, DIOCGFWSECTORS,
+ &dlp.d_nsectors) == -1) {
+ warn("cannot get number of sectors per track");
+ dlp.d_nsectors = 63;
+ }
+ if (bpb->bpbHeads == 0 &&
+ ioctl(fd, DIOCGFWHEADS, &dlp.d_ntracks) == -1) {
+ warn("cannot get number of heads");
+ if (dlp.d_secperunit <= 63*1*1024)
+ dlp.d_ntracks = 1;
+ else if (dlp.d_secperunit <= 63*16*1024)
+ dlp.d_ntracks = 16;
+ else
+ dlp.d_ntracks = 255;
}
hs = (ms / dlp.d_secsize) - dlp.d_secperunit;
OpenPOWER on IntegriCloud