mirror of
https://github.com/wiiu-env/wut.git
synced 2024-12-04 19:44:16 +01:00
libwhb: Use FS_ERROR_FLAG_ALL instead of -1
This commit is contained in:
parent
510409db7a
commit
af99d5acbd
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user