From 8fbf1c61691f7fec273318e1bf5f9b0393b39d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 16 Oct 2003 18:00:28 +0000 Subject: [PATCH] Since there currently are no directory traversing functions, I've added a temporary get_node_from() function which returns the Node assigned to the file descriptor. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5047 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/boot/loader/vfs.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/kernel/boot/loader/vfs.cpp b/src/kernel/boot/loader/vfs.cpp index 3a189896dd..e34df7a1ba 100644 --- a/src/kernel/boot/loader/vfs.cpp +++ b/src/kernel/boot/loader/vfs.cpp @@ -45,6 +45,8 @@ class Descriptor { status_t Acquire(); status_t Release(); + Node *GetNode() const { return fNode; } + private: Node *fNode; void *fCookie; @@ -588,6 +590,22 @@ open_from(Directory *directory, const char *name, int mode) } +/** Since we don't have directory functions yet, this + * function is needed to get the contents of a directory. + * It should be removed once readdir() & co. are in place. + */ + +Node * +get_node_from(int fd) +{ + Descriptor *descriptor = get_descriptor(fd); + if (descriptor == NULL) + return NULL; + + return descriptor->GetNode(); +} + + int close(int fd) {