mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-23 21:14:49 +00:00
fix
This commit is contained in:
parent
e578d30911
commit
99d4a37a1d
1 changed files with 14 additions and 5 deletions
|
@ -673,7 +673,7 @@ void Utils::RebootToFatalError(AtmosphereFatalErrorContext *ctx) {
|
|||
void Utils::CreateBlankProdInfoIfNeeded() {
|
||||
Result rc;
|
||||
|
||||
rc = fsFsOpenFile(&g_sd_filesystem, "/atmosphere/automatic_backups/prodinfo_blank.bin", FS_OPEN_READ | FS_OPEN_WRITE, &g_blank_prodinfo_file);
|
||||
rc = fsFsOpenFile(&g_sd_filesystem, "/atmosphere/automatic_backups/prodinfo_blank.bin", FS_OPEN_READ, &g_blank_prodinfo_file);
|
||||
if (R_SUCCEEDED(rc)) {
|
||||
return;
|
||||
}
|
||||
|
@ -723,22 +723,31 @@ void Utils::CreateBlankProdInfoIfNeeded() {
|
|||
memcpy(&p[hash_offset], hash, 0x20);
|
||||
}
|
||||
|
||||
rc = fsFsOpenFile(&g_sd_filesystem, "/atmosphere/automatic_backups/prodinfo_blank.bin", FS_OPEN_READ | FS_OPEN_WRITE, &g_blank_prodinfo_file);
|
||||
FsFile file;
|
||||
|
||||
rc = fsFsOpenFile(&g_sd_filesystem, "/atmosphere/automatic_backups/prodinfo_blank.bin", FS_OPEN_WRITE, &file);
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
rc = fsFileSetSize(&g_blank_prodinfo_file, ProdinfoSize);
|
||||
rc = fsFileSetSize(&file, ProdinfoSize);
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
rc = fsFileWrite(&g_blank_prodinfo_file, 0, p, ProdinfoSize);
|
||||
rc = fsFileWrite(&file, 0, p, ProdinfoSize);
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
rc = fsFileFlush(&g_blank_prodinfo_file);
|
||||
rc = fsFileFlush(&file);
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
||||
fsFileClose(&file);
|
||||
|
||||
rc = fsFsOpenFile(&g_sd_filesystem, "/atmosphere/automatic_backups/prodinfo_blank.bin", FS_OPEN_READ, &g_blank_prodinfo_file);
|
||||
if (R_FAILED(rc)) {
|
||||
std::abort();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue