mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Don't write to a read-only file
This commit is contained in:
parent
8ead72ed84
commit
95ef1c9529
1 changed files with 10 additions and 0 deletions
|
@ -190,6 +190,16 @@ namespace LibHac.FsService.Impl
|
||||||
rc = _fileSystem.OpenFile(out contextFile, ContextFileName, OpenMode.Read);
|
rc = _fileSystem.OpenFile(out contextFile, ContextFileName, OpenMode.Read);
|
||||||
if (rc.IsFailure()) return rc;
|
if (rc.IsFailure()) return rc;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
contextFile?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Result rc = _fileSystem.OpenFile(out contextFile, ContextFileName, OpenMode.ReadWrite);
|
||||||
|
if (rc.IsFailure()) return rc;
|
||||||
|
|
||||||
_context.Version = CurrentContextVersion;
|
_context.Version = CurrentContextVersion;
|
||||||
_context.State = CommitState.NotCommitted;
|
_context.State = CommitState.NotCommitted;
|
||||||
|
|
Loading…
Reference in a new issue