提交 febe447d 编写于 作者: X xionglei6

init: modify fixed misc file about issue

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
Change-Id: I07a14bb637e1c09022e0c79fb6de839297048987
上级 7ee6dc2b
......@@ -288,6 +288,23 @@ FstabItem *FindFstabItemForPath(Fstab fstab, const char *path)
return item;
}
int GetPartitionFilePath(const char *filePath, const char *partitionName, char *partitionPath, size_t pathSize)
{
Fstab *fstab = NULL;
FstabItem *miscItem = NULL;
if ((fstab = ReadFstabFromFile(filePath, false)) != NULL) {
miscItem = FindFstabItemForMountPoint(*fstab, partitionName);
INIT_ERROR_CHECK(miscItem != NULL, ReleaseFstab(fstab); return -1, "Failed to find misc partition");
} else {
FSMGR_LOGE("Failed to ReadFstabFromFile");
return -1;
}
int ret = strcpy_s(partitionPath, pathSize, miscItem->deviceName);
INIT_ERROR_CHECK(ret == EOK, ReleaseFstab(fstab); return -1, "Failed to copy misc device name");
ReleaseFstab(fstab);
return 0;
}
static const struct MountFlags mountFlags[] = {
{ "noatime", MS_NOATIME },
{ "noexec", MS_NOEXEC },
......@@ -382,4 +399,4 @@ unsigned long GetMountFlags(char *mountFlag, char *fsSpecificData, size_t fsSpec
#if __cplusplus
}
#endif
#endif
\ No newline at end of file
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册