fix: 其他分区已mount时会引起格式化失败

【背景】其他分区已mount时会引起格式化失败

【修改方案】
1, 格式化时判断方式修改为路径

【影响】
对现有的产品编译不会有影响。
re #I61P4K
Signed-off-by: wangchen <wangchen240@huawei.com>
This commit is contained in:
wangchen 2022-11-17 13:00:31 +00:00
parent 3019311435
commit 08436dec9e
1 changed files with 1 additions and 2 deletions

View File

@ -160,8 +160,7 @@ int LOS_PartitionFormat(const char *partName, char *fsType, void *data)
format is not allowed when the device has been mounted. */ format is not allowed when the device has been mounted. */
struct MountPoint *iter = NULL; struct MountPoint *iter = NULL;
LOS_MP_FOR_EACH_ENTRY(iter) { LOS_MP_FOR_EACH_ENTRY(iter) {
if ((iter->mFs != NULL) && (iter->mFs->fsType != NULL) && if ((iter->mPath != NULL) && (strcmp(iter->mPath, partName) == 0)) {
strcmp(iter->mFs->fsType, fsType) == 0) {
errno = EBUSY; errno = EBUSY;
return (int)LOS_NOK; return (int)LOS_NOK;
} }