mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
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:
parent
c48e13e1c0
commit
b80428abf6
@ -126,4 +126,4 @@ namespace File_system {
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* _VFS__ASSERT_H_ */
|
||||
|
@ -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_ */
|
||||
|
Loading…
Reference in New Issue
Block a user