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
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user