mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-02 15:49:48 -04:00
Prevent automatic placeholder creation on open
This commit is contained in:
parent
f080f6793b
commit
6e5c0bde51
7 changed files with 55 additions and 24 deletions
|
@ -82,15 +82,12 @@ namespace sts::ncm {
|
|||
this->ClearContentCache();
|
||||
char content_path[FS_MAX_PATH] = {0};
|
||||
this->GetContentPath(content_path, content_id);
|
||||
this->content_cache_file_handle = fopen(content_path, "rb");
|
||||
|
||||
if (this->content_cache_file_handle == NULL) {
|
||||
R_TRY_CATCH(fsdevGetLastResult()) {
|
||||
R_CATCH(ResultFsPathNotFound) {
|
||||
return ResultNcmContentNotFound;
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
}
|
||||
R_TRY_CATCH(OpenFile(&this->content_cache_file_handle, content_path, FS_OPEN_READ)) {
|
||||
R_CATCH(ResultFsPathNotFound) {
|
||||
return ResultNcmContentNotFound;
|
||||
}
|
||||
} R_END_TRY_CATCH;
|
||||
|
||||
this->cached_content_id = content_id;
|
||||
return ResultSuccess;
|
||||
|
@ -624,15 +621,13 @@ namespace sts::ncm {
|
|||
char content_path[FS_MAX_PATH] = {0};
|
||||
this->GetContentPath(content_path, content_id);
|
||||
|
||||
FILE* f = fopen(content_path, "r+b");
|
||||
FILE* f = nullptr;
|
||||
R_TRY(OpenFile(&f, content_path, FS_OPEN_WRITE));
|
||||
|
||||
ON_SCOPE_EXIT {
|
||||
fclose(f);
|
||||
};
|
||||
|
||||
if (f == nullptr) {
|
||||
return fsdevGetLastResult();
|
||||
}
|
||||
|
||||
if (fseek(f, offset, SEEK_SET) != 0) {
|
||||
return fsdevGetLastResult();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue