mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:27:35 +00:00
Kernel: Tidy up FileDescriptor members a bit.
This commit is contained in:
parent
123283d840
commit
237628a7a6
5 changed files with 10 additions and 13 deletions
|
@ -51,12 +51,12 @@ FIFO::~FIFO()
|
|||
|
||||
void FIFO::attach(Direction direction)
|
||||
{
|
||||
if (direction == Reader) {
|
||||
if (direction == Direction::Reader) {
|
||||
++m_readers;
|
||||
#ifdef FIFO_DEBUG
|
||||
kprintf("open reader (%u)\n", m_readers);
|
||||
#endif
|
||||
} else if (direction == Writer) {
|
||||
} else if (direction == Direction::Writer) {
|
||||
++m_writers;
|
||||
#ifdef FIFO_DEBUG
|
||||
kprintf("open writer (%u)\n", m_writers);
|
||||
|
@ -66,13 +66,13 @@ void FIFO::attach(Direction direction)
|
|||
|
||||
void FIFO::detach(Direction direction)
|
||||
{
|
||||
if (direction == Reader) {
|
||||
if (direction == Direction::Reader) {
|
||||
#ifdef FIFO_DEBUG
|
||||
kprintf("close reader (%u - 1)\n", m_readers);
|
||||
#endif
|
||||
ASSERT(m_readers);
|
||||
--m_readers;
|
||||
} else if (direction == Writer) {
|
||||
} else if (direction == Direction::Writer) {
|
||||
#ifdef FIFO_DEBUG
|
||||
kprintf("close writer (%u - 1)\n", m_writers);
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@ class FileDescriptor;
|
|||
|
||||
class FIFO final : public File {
|
||||
public:
|
||||
enum Direction {
|
||||
enum class Direction : byte {
|
||||
Neither, Reader, Writer
|
||||
};
|
||||
|
||||
|
|
|
@ -110,13 +110,10 @@ private:
|
|||
|
||||
ByteBuffer m_generator_cache;
|
||||
|
||||
bool m_is_blocking { true };
|
||||
dword m_file_flags { 0 };
|
||||
|
||||
bool m_is_blocking { true };
|
||||
SocketRole m_socket_role { SocketRole::None };
|
||||
|
||||
FIFO::Direction m_fifo_direction { FIFO::Neither };
|
||||
|
||||
bool m_closed { false };
|
||||
FIFO::Direction m_fifo_direction { FIFO::Direction::Neither };
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue