server/vfs: fix file leaf path pointer

Directory_service::leaf_path returns a pointer offset from its argument
so pass member data rather than a constructor argument to leaf_path.

Issue #1775
This commit is contained in:
Emery Hemingway 2016-05-25 22:11:09 +02:00 committed by Christian Helmuth
parent c48e13e1c0
commit b80428abf6
2 changed files with 4 additions and 4 deletions

View File

@ -126,4 +126,4 @@ namespace File_system {
}
}
#endif
#endif /* _VFS__ASSERT_H_ */

View File

@ -131,6 +131,7 @@ class Vfs_server::File : public Node
char const *_leaf_path; /* offset pointer to Node::_path */
public:
File(Vfs::File_system &vfs,
Genode::Allocator &alloc,
char const *file_path,
@ -142,7 +143,7 @@ class Vfs_server::File : public Node
(fs_mode-1) | (create ? Vfs::Directory_service::OPEN_MODE_CREATE : 0);
assert_open(vfs.open(file_path, vfs_mode, &_handle, alloc));
_leaf_path = vfs.leaf_path(file_path);
_leaf_path = vfs.leaf_path(path());
}
~File() { _handle->ds().close(_handle); }
@ -289,5 +290,4 @@ struct Vfs_server::Directory : Node
}
};
#endif
#endif /* _VFS__NODE_H_ */