tmpfs: Disallow creating files/folders with already used names
This commit is contained in:
parent
d95ef110c9
commit
ac304073b4
@ -66,6 +66,8 @@ namespace TmpFS
|
||||
|
||||
Result<SharedPtr<VFS::Inode>> DirInode::create_file(const char* name)
|
||||
{
|
||||
if (find(name).has_value()) return err(EEXIST);
|
||||
|
||||
auto inode = TRY(m_fs->create_file_inode());
|
||||
|
||||
TRY(add_entry(inode, name));
|
||||
@ -75,6 +77,8 @@ namespace TmpFS
|
||||
|
||||
Result<SharedPtr<VFS::Inode>> DirInode::create_subdirectory(const char* name)
|
||||
{
|
||||
if (find(name).has_value()) return err(EEXIST);
|
||||
|
||||
auto inode = TRY(m_fs->create_dir_inode(m_self));
|
||||
|
||||
TRY(add_entry(inode, name));
|
||||
|
Loading…
Reference in New Issue
Block a user