提交 9d683355 编写于 作者: C chengjinsong 提交者: cheng_jinsong

fixed e64623a6 from https://gitee.com/chneg-jinsong/startup_init_lite/pulls/1339

nofail
Signed-off-by: Nchengjinsong <chengjinsong2@huawei.com>
Change-Id: I59f131d939c780c4208b8a49690ba3d562c3a3f3
上级 85d86bd3
......@@ -50,6 +50,7 @@ static unsigned int ConvertFlags(char *flagBuffer)
{"check", FS_MANAGER_CHECK},
{"wait", FS_MANAGER_WAIT},
{"required", FS_MANAGER_REQUIRED},
{"nofail", FS_MANAGER_NOFAIL},
};
BEGET_CHECK_RETURN_VALUE(flagBuffer != NULL && *flagBuffer != '\0', 0); // No valid flags.
......
......@@ -406,7 +406,12 @@ int MountOneItem(FstabItem *item)
int rc = Mount(item->deviceName, item->mountPoint, item->fsType, mountFlags, fsSpecificData);
if (rc != 0) {
BEGET_LOGE("Mount %s to %s failed %d", item->deviceName, item->mountPoint, errno);
if (FM_MANAGER_NOFAIL_ENABLED(item->fsManagerFlags)) {
BEGET_LOGE("Mount no fail device %s to %s failed, err = %d", item->deviceName, item->mountPoint, errno);
} else {
BEGET_LOGW("Mount %s to %s failed, err = %d. Ignore failure", item->deviceName, item->mountPoint, errno);
rc = 0;
}
} else {
BEGET_LOGI("Mount %s to %s successful", item->deviceName, item->mountPoint);
}
......
......@@ -29,6 +29,7 @@ extern "C" {
#define FS_MANAGER_CHECK 0x00000001
#define FS_MANAGER_WAIT 0x00000002
#define FS_MANAGER_REQUIRED 0x00000004
#define FS_MANAGER_NOFAIL 0x00000008
#define NAME_SIZE 32
#define MAX_SLOT 2
......@@ -38,6 +39,7 @@ extern "C" {
#define FM_MANAGER_CHECK_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), CHECK)
#define FM_MANAGER_WAIT_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), WAIT)
#define FM_MANAGER_REQUIRED_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), REQUIRED)
#define FM_MANAGER_NOFAIL_ENABLED(fsMgrFlags) FS_MANAGER_FLAGS_ENABLED((fsMgrFlags), NOFAIL)
typedef enum MountStatus {
MOUNT_ERROR = -1,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册