From b48c7f231ad09efc25d71a18a824f5bfa09618a4 Mon Sep 17 00:00:00 2001 From: "Bruno G. Albuquerque" Date: Tue, 1 Apr 2008 15:38:01 +0000 Subject: [PATCH] - vnode_path_to_vnode() now returns B_NOT_A_DIRECTORY instead of B_NOT_ALLOWED as expected by POSIX programs. This allowed be to compile Haiku under itself without any hacks at all, so I guess this means that now we are officially self-hosting! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24720 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/fs/vfs.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 9f24ad74ef..ad949d9781 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -1821,6 +1821,15 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink, if (status < B_OK) { put_vnode(vnode); + if (status == B_NOT_ALLOWED) { + // We are only concerned about directories here, so + // B_NOT_ALLOWED is actually B_NOT_A_DIRECTORY. This + // happens because fs_access() can be called on files + // to and this would be valid outside of the context + // of vnode_path_to_vnode(). This is also what POSIX + // programs expect as return code in this case. + return B_NOT_A_DIRECTORY; + } return status; }