FileDescriptor: add operator=() so that the fcntl(F_DUPFD syscall compiles :)

This commit is contained in:
apio 2022-10-15 11:16:18 +02:00
parent 5c61252061
commit 36bb1cab5c
2 changed files with 12 additions and 0 deletions

View File

@ -43,6 +43,8 @@ struct Descriptor
Descriptor(const Descriptor& other); Descriptor(const Descriptor& other);
Descriptor(); Descriptor();
const Descriptor& operator=(const Descriptor& other);
private: private:
bool m_is_open; bool m_is_open;
bool m_can_read; bool m_can_read;

View File

@ -41,3 +41,13 @@ int Descriptor::seek(long offset)
m_offset = (uint64_t)offset; m_offset = (uint64_t)offset;
return 0; return 0;
} }
const Descriptor& Descriptor::operator=(const Descriptor& other)
{
m_is_open = other.m_is_open;
m_can_read = other.m_can_read;
m_can_write = other.m_can_write;
m_offset = other.m_offset;
m_node = other.m_node;
return other;
}