Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party FreeBSD
提交
00ee65d9
T
Third Party FreeBSD
项目概览
OpenHarmony
/
Third Party FreeBSD
接近 2 年 前同步成功
通知
3
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party FreeBSD
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
00ee65d9
编写于
6月 25, 2022
作者:
张
张文迪
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete abandoned code and modify code style
Signed-off-by:
N
张文迪
<
zhangwendi3@huawei.com
>
上级
a6068434
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
68 deletion
+5
-68
sbin/newfs_msdos/mkfs_msdos.c
sbin/newfs_msdos/mkfs_msdos.c
+5
-68
未找到文件。
sbin/newfs_msdos/mkfs_msdos.c
浏览文件 @
00ee65d9
...
@@ -226,7 +226,6 @@ static const u_int8_t bootcode[] = {
...
@@ -226,7 +226,6 @@ static const u_int8_t bootcode[] = {
static
volatile
sig_atomic_t
got_siginfo
;
static
volatile
sig_atomic_t
got_siginfo
;
static
void
infohandler
(
int
);
static
void
infohandler
(
int
);
static
int
check_mounted
(
const
char
*
,
mode_t
);
static
ssize_t
getchunksize
(
void
);
static
ssize_t
getchunksize
(
void
);
static
int
getstdfmt
(
const
char
*
,
struct
bpb
*
);
static
int
getstdfmt
(
const
char
*
,
struct
bpb
*
);
static
int
getdiskinfo
(
int
,
const
char
*
,
const
char
*
,
int
,
struct
bpb
*
);
static
int
getdiskinfo
(
int
,
const
char
*
,
const
char
*
,
int
,
struct
bpb
*
);
...
@@ -307,11 +306,6 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
...
@@ -307,11 +306,6 @@ mkfs_msdos(const char *fname, const char *dtype, const struct msdos_options *op)
warnx
(
"warning, %s is not a character device"
,
fname
);
warnx
(
"warning, %s is not a character device"
,
fname
);
#endif
#endif
}
}
#ifndef MAKEFS
if
(
!
o
.
no_create
)
if
(
check_mounted
(
fname
,
sb
.
st_mode
)
==
-
1
)
goto
done
;
#endif
if
(
o
.
offset
&&
o
.
offset
!=
lseek
(
fd
,
o
.
offset
,
SEEK_SET
))
{
if
(
o
.
offset
&&
o
.
offset
!=
lseek
(
fd
,
o
.
offset
,
SEEK_SET
))
{
warnx
(
"cannot seek to %jd"
,
(
intmax_t
)
o
.
offset
);
warnx
(
"cannot seek to %jd"
,
(
intmax_t
)
o
.
offset
);
goto
done
;
goto
done
;
...
@@ -801,45 +795,6 @@ done:
...
@@ -801,45 +795,6 @@ done:
return
rv
;
return
rv
;
}
}
/*
* return -1 with error if file system is mounted.
*/
static
int
check_mounted
(
const
char
*
fname
,
mode_t
mode
)
{
/*
* If getmntinfo() is not available (e.g. Linux) don't check. This should
* not be a problem since we will only be using makefs to create images.
*/
#if 0 && !defined(MAKEFS)
struct statfs *mp;
const char *s1, *s2;
size_t len;
int n, r;
if (!(n = getmntinfo(&mp, MNT_NOWAIT))) {
warn("getmntinfo");
return -1;
}
len = strlen(_PATH_DEV);
s1 = fname;
if (!strncmp(s1, _PATH_DEV, len))
s1 += len;
r = S_ISCHR(mode) && s1 != fname && *s1 == 'r';
for (; n--; mp++) {
s2 = mp->f_mntfromname;
if (!strncmp(s2, _PATH_DEV, len))
s2 += len;
if ((r && s2 != mp->f_mntfromname && !strcmp(s1 + 1, s2)) ||
!strcmp(s1, s2)) {
warnx("%s is mounted on %s", fname, mp->f_mntonname);
return -1;
}
}
#endif
return
0
;
}
/*
/*
* Get optimal I/O size
* Get optimal I/O size
*/
*/
...
@@ -899,40 +854,22 @@ getstdfmt(const char *fmt, struct bpb *bpb)
...
@@ -899,40 +854,22 @@ getstdfmt(const char *fmt, struct bpb *bpb)
return
0
;
return
0
;
}
}
#if 0
static void
compute_geometry_from_file(int fd, const char *fname, struct disklabel *lp)
{
struct stat st;
off_t ms;
if (fstat(fd, &st))
err(1, "cannot get disk size");
if (!S_ISREG(st.st_mode))
errx(1, "%s is not a regular file", fname);
ms = st.st_size;
lp->d_secsize = 512;
lp->d_nsectors = 63;
lp->d_ntracks = 255;
lp->d_secperunit = ms / lp->d_secsize;
}
#endif
/*
/*
* Get disk slice, partition, and geometry information.
* Get disk slice, partition, and geometry information.
*/
*/
#if defined(__linux__)
#if defined(__linux__)
static
int
getdiskinfo
(
int
fd
,
const
char
*
fname
,
const
char
*
dtype
,
static
int
int
oflag
,
struct
bpb
*
bpb
)
getdiskinfo
(
int
fd
,
const
char
*
fname
,
const
char
*
dtype
,
int
oflag
,
struct
bpb
*
bpb
)
{
{
if
(
ioctl
(
fd
,
BLKSSZGET
,
&
bpb
->
bpbBytesPerSec
))
{
if
(
ioctl
(
fd
,
BLKSSZGET
,
&
bpb
->
bpbBytesPerSec
)
==
-
1
)
{
err
(
1
,
"ioctl(BLKSSZGET) for bytes/sector failed"
);
err
(
1
,
"ioctl(BLKSSZGET) for bytes/sector failed"
);
}
}
if
(
ckgeom
(
fname
,
bpb
->
bpbBytesPerSec
,
"bytes/sector"
)
==
-
1
)
return
-
1
;
if
(
ckgeom
(
fname
,
bpb
->
bpbBytesPerSec
,
"bytes/sector"
)
==
-
1
)
return
-
1
;
u_int64_t
device_size
;
u_int64_t
device_size
;
if
(
ioctl
(
fd
,
BLKGETSIZE64
,
&
device_size
))
{
if
(
ioctl
(
fd
,
BLKGETSIZE64
,
&
device_size
)
==
-
1
)
{
err
(
1
,
"ioctl(BLKGETSIZE64) failed"
);
err
(
1
,
"ioctl(BLKGETSIZE64) failed"
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录