diff --git a/kernel/include/fs/FileDescriptor.h b/kernel/include/fs/FileDescriptor.h index d9ff1480..b6ee909b 100644 --- a/kernel/include/fs/FileDescriptor.h +++ b/kernel/include/fs/FileDescriptor.h @@ -43,6 +43,8 @@ struct Descriptor Descriptor(const Descriptor& other); Descriptor(); + const Descriptor& operator=(const Descriptor& other); + private: bool m_is_open; bool m_can_read; diff --git a/kernel/src/fs/FileDescriptor.cpp b/kernel/src/fs/FileDescriptor.cpp index d45d41b6..eb4e2da9 100644 --- a/kernel/src/fs/FileDescriptor.cpp +++ b/kernel/src/fs/FileDescriptor.cpp @@ -40,4 +40,14 @@ int Descriptor::seek(long offset) return -EINVAL; // FIXME: Support seeking beyond the current file's length. m_offset = (uint64_t)offset; 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; } \ No newline at end of file