Don't retry opening the node read-only, if opening read-write failed with B_ENTRY_NOT_FOUND.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10697 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -700,7 +700,7 @@ BNode::_SetTo(int fd, const char *path, bool traverse)
|
||||
if (error == B_OK) {
|
||||
int traverseFlag = (traverse ? 0 : O_NOTRAVERSE);
|
||||
fFd = _kern_open(fd, path, O_RDWR | traverseFlag);
|
||||
if (fFd < B_OK) {
|
||||
if (fFd < B_OK && fFd != B_ENTRY_NOT_FOUND) {
|
||||
// opening read-write failed, re-try read-only
|
||||
fFd = _kern_open(fd, path, O_RDONLY | traverseFlag);
|
||||
}
|
||||
@@ -734,7 +734,7 @@ BNode::_SetTo(const entry_ref *ref, bool traverse)
|
||||
int traverseFlag = (traverse ? 0 : O_NOTRAVERSE);
|
||||
fFd = _kern_open_entry_ref(ref->device, ref->directory, ref->name,
|
||||
O_RDWR | traverseFlag);
|
||||
if (fFd < B_OK) {
|
||||
if (fFd < B_OK && fFd != B_ENTRY_NOT_FOUND) {
|
||||
// opening read-write failed, re-try read-only
|
||||
fFd = _kern_open_entry_ref(ref->device, ref->directory, ref->name,
|
||||
O_RDONLY | traverseFlag);
|
||||
|
||||
Reference in New Issue
Block a user