Kernel: Make VirtualFileSystem::File non copyable
This commit is contained in:
@@ -123,7 +123,7 @@ namespace Kernel
|
||||
memcpy(address, &connection.target.address, *address_len);
|
||||
}
|
||||
|
||||
return TRY(Process::current().open_inode(return_inode, O_RDWR | flags));
|
||||
return TRY(Process::current().open_inode(VirtualFileSystem::File(return_inode, "<tcp socket>"_sv), O_RDWR | flags));
|
||||
}
|
||||
|
||||
BAN::ErrorOr<void> TCPSocket::connect_impl(const sockaddr* address, socklen_t address_len)
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Kernel
|
||||
strncpy(sockaddr_un.sun_path, pending->m_bound_path.data(), copy_len);
|
||||
}
|
||||
|
||||
return TRY(Process::current().open_inode(return_inode, O_RDWR | flags));
|
||||
return TRY(Process::current().open_inode(VirtualFileSystem::File(return_inode, "<unix socket>"_sv), O_RDWR | flags));
|
||||
}
|
||||
|
||||
BAN::ErrorOr<void> UnixDomainSocket::connect_impl(const sockaddr* address, socklen_t address_len)
|
||||
|
||||
@@ -875,11 +875,11 @@ namespace Kernel
|
||||
return false;
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::open_inode(BAN::RefPtr<Inode> inode, int flags)
|
||||
BAN::ErrorOr<long> Process::open_inode(VirtualFileSystem::File&& file, int flags)
|
||||
{
|
||||
ASSERT(inode);
|
||||
ASSERT(file.inode);
|
||||
LockGuard _(m_process_lock);
|
||||
return TRY(m_open_file_descriptors.open(VirtualFileSystem::File { .inode = inode, .canonical_path = {} }, flags));
|
||||
return TRY(m_open_file_descriptors.open(BAN::move(file), flags));
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::open_file(BAN::StringView path, int flags, mode_t mode)
|
||||
|
||||
Reference in New Issue
Block a user