BResources::SetTo(): try opening read-only on error

Fixes #9843.
This commit is contained in:
Ingo Weinhold
2013-06-30 14:06:29 +02:00
parent 4c851c295d
commit 207389a060
+4
View File
@@ -141,6 +141,8 @@ BResources::SetTo(const char* path, bool clobber)
// open file
BFile file;
status_t error = file.SetTo(path, B_READ_WRITE);
if (error != B_OK && error != B_ENTRY_NOT_FOUND)
error = file.SetTo(path, B_READ_ONLY);
if (error != B_OK) {
Unset();
return error;
@@ -162,6 +164,8 @@ BResources::SetTo(const entry_ref* ref, bool clobber)
// open file
BFile file;
status_t error = file.SetTo(ref, B_READ_WRITE);
if (error != B_OK && error != B_ENTRY_NOT_FOUND)
error = file.SetTo(ref, B_READ_ONLY);
if (error != B_OK) {
Unset();
return error;