sprofile: update for 14.0.0 (orphaned profiles now deleted on import)

This commit is contained in:
Michael Scire
2022-03-21 23:20:31 -07:00
committed by SciresM
parent 588d761615
commit 0cfc93d423
22 changed files with 320 additions and 112 deletions

View File

@@ -33,7 +33,7 @@ namespace ams::sprofile::srv {
/* Check the size was correct. */
AMS_ABORT_UNLESS(size == read_size);
return ResultSuccess();
R_SUCCEED();
}
Result WriteFile(const char *path, const void *src, size_t size) {
@@ -51,7 +51,7 @@ namespace ams::sprofile::srv {
R_ABORT_UNLESS(fs::SetFileSize(file, size));
/* Write the file. */
return fs::WriteFile(file, 0, src, size, fs::WriteOption::Flush);
R_RETURN(fs::WriteFile(file, 0, src, size, fs::WriteOption::Flush));
}
Result MoveFile(const char *src_path, const char *dst_path) {
@@ -70,7 +70,15 @@ namespace ams::sprofile::srv {
/* Move the source file to the destination file. */
R_TRY(fs::RenameFile(src_path, dst_path));
return ResultSuccess();
R_SUCCEED();
}
Result DeleteFile(const char *path) {
R_TRY_CATCH(fs::DeleteFile(path)) {
R_CATCH(fs::ResultPathNotFound) { /* It's okay if the file doesn't exist. */ }
} R_END_TRY_CATCH;
R_SUCCEED();
}
Result EnsureDirectory(const char *path) {
@@ -78,7 +86,7 @@ namespace ams::sprofile::srv {
R_CATCH(fs::ResultPathAlreadyExists) { /* It's okay if the directory already exists. */ }
} R_END_TRY_CATCH;
return ResultSuccess();
R_SUCCEED();
}
}