From af99d5acbde8447fda486942f2b402e0210b7151 Mon Sep 17 00:00:00 2001 From: Maschell Date: Tue, 29 Dec 2020 09:43:22 +0100 Subject: [PATCH] libwhb: Use FS_ERROR_FLAG_ALL instead of -1 --- libraries/libwhb/src/file.c | 12 ++++++------ libraries/libwhb/src/sdcard.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libraries/libwhb/src/file.c b/libraries/libwhb/src/file.c index df12c7c..cc462d8 100644 --- a/libraries/libwhb/src/file.c +++ b/libraries/libwhb/src/file.c @@ -16,7 +16,7 @@ InitFileSystem() if (!sInitialised) { FSInit(); - if (FSAddClient(&sClient, -1) != FS_STATUS_OK) { + if (FSAddClient(&sClient, FS_ERROR_FLAG_ALL) != FS_STATUS_OK) { return FALSE; } @@ -30,7 +30,7 @@ BOOL WHBDeInitFileSystem() { if (sInitialised) { - if (FSDelClient(&sClient, -1) != FS_STATUS_OK) { + if (FSDelClient(&sClient, FS_ERROR_FLAG_ALL) != FS_STATUS_OK) { return FALSE; } @@ -62,7 +62,7 @@ WHBOpenFile(const char *path, } FSInitCmdBlock(&cmd); - result = FSOpenFile(&sClient, &cmd, tmp, mode, &handle, -1); + result = FSOpenFile(&sClient, &cmd, tmp, mode, &handle, FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSOpenFile error %d", __FUNCTION__, result); return WHB_FILE_FATAL_ERROR; @@ -78,7 +78,7 @@ WHBGetFileSize(int32_t handle) FSStatus result; FSStat stat; FSInitCmdBlock(&cmd); - result = FSGetStatFile(&sClient, &cmd, (FSFileHandle)handle, &stat, -1); + result = FSGetStatFile(&sClient, &cmd, (FSFileHandle)handle, &stat, FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSGetStatFile error %d", __FUNCTION__, result); return 0; @@ -96,7 +96,7 @@ WHBReadFile(int32_t handle, FSCmdBlock cmd; FSStatus result; FSInitCmdBlock(&cmd); - result = FSReadFile(&sClient, &cmd, buf, size, count, (FSFileHandle)handle, 0, -1); + result = FSReadFile(&sClient, &cmd, buf, size, count, (FSFileHandle)handle, 0, FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSReadFile error %d", __FUNCTION__, result); return 0; @@ -111,7 +111,7 @@ WHBCloseFile(int32_t handle) FSCmdBlock cmd; FSStatus result; FSInitCmdBlock(&cmd); - result = FSCloseFile(&sClient, &cmd, (FSFileHandle)handle, -1); + result = FSCloseFile(&sClient, &cmd, (FSFileHandle)handle, FS_ERROR_FLAG_ALL); if (result != FS_STATUS_OK) { WHBLogPrintf("%s: FSCloseFile error %d", __FUNCTION__, result); return WHB_FILE_FATAL_ERROR; diff --git a/libraries/libwhb/src/sdcard.c b/libraries/libwhb/src/sdcard.c index 8722ec2..3c0582c 100644 --- a/libraries/libwhb/src/sdcard.c +++ b/libraries/libwhb/src/sdcard.c @@ -24,20 +24,20 @@ WHBMountSdCard() FSInit(); - result = FSAddClient(&sClient, -1); + result = FSAddClient(&sClient, FS_ERROR_FLAG_ALL); if (result != FS_STATUS_OK) { WHBLogPrintf("%s: FSAddClient error %d", __FUNCTION__, result); return FALSE; } FSInitCmdBlock(&cmd); - result = FSGetMountSource(&sClient, &cmd, FS_MOUNT_SOURCE_SD, &mountSource, -1); + result = FSGetMountSource(&sClient, &cmd, FS_MOUNT_SOURCE_SD, &mountSource, FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSGetMountSource error %d", __FUNCTION__, result); goto fail; } - result = FSMount(&sClient, &cmd, &mountSource, sMountPath, sizeof(sMountPath), -1); + result = FSMount(&sClient, &cmd, &mountSource, sMountPath, sizeof(sMountPath), FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSMount error %d", __FUNCTION__, result); goto fail; @@ -47,7 +47,7 @@ WHBMountSdCard() return TRUE; fail: - FSDelClient(&sClient, -1); + FSDelClient(&sClient, FS_ERROR_FLAG_ALL); return FALSE; } @@ -69,13 +69,13 @@ WHBUnmountSdCard() FSInitCmdBlock(&cmd); - result = FSUnmount(&sClient, &cmd, sMountPath, -1); + result = FSUnmount(&sClient, &cmd, sMountPath, FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSUnmount error %d", __FUNCTION__, result); return FALSE; } - result = FSDelClient(&sClient, -1); + result = FSDelClient(&sClient, FS_ERROR_FLAG_ALL); if (result < 0) { WHBLogPrintf("%s: FSDelClient error %d", __FUNCTION__, result); return FALSE;