diff options
-rw-r--r-- | Kernel/FileSystem/FIFO.cpp | 8 | ||||
-rw-r--r-- | Kernel/FileSystem/FIFO.h | 2 | ||||
-rw-r--r-- | Kernel/FileSystem/FileDescriptor.h | 7 | ||||
-rw-r--r-- | Kernel/Net/Socket.h | 2 | ||||
-rw-r--r-- | Kernel/Process.cpp | 4 |
5 files changed, 10 insertions, 13 deletions
diff --git a/Kernel/FileSystem/FIFO.cpp b/Kernel/FileSystem/FIFO.cpp index 1140a911ab..e20c022dbd 100644 --- a/Kernel/FileSystem/FIFO.cpp +++ b/Kernel/FileSystem/FIFO.cpp @@ -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 diff --git a/Kernel/FileSystem/FIFO.h b/Kernel/FileSystem/FIFO.h index ac1a0bd1c5..b9eea984cb 100644 --- a/Kernel/FileSystem/FIFO.h +++ b/Kernel/FileSystem/FIFO.h @@ -8,7 +8,7 @@ class FileDescriptor; class FIFO final : public File { public: - enum Direction { + enum class Direction : byte { Neither, Reader, Writer }; diff --git a/Kernel/FileSystem/FileDescriptor.h b/Kernel/FileSystem/FileDescriptor.h index ecaae157e4..98631ce0ba 100644 --- a/Kernel/FileSystem/FileDescriptor.h +++ b/Kernel/FileSystem/FileDescriptor.h @@ -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 }; }; diff --git a/Kernel/Net/Socket.h b/Kernel/Net/Socket.h index ca5d0f32e9..151e250268 100644 --- a/Kernel/Net/Socket.h +++ b/Kernel/Net/Socket.h @@ -9,7 +9,7 @@ #include <Kernel/UnixTypes.h> #include <Kernel/KResult.h> -enum class SocketRole { None, Listener, Accepted, Connected, Connecting }; +enum class SocketRole : byte { None, Listener, Accepted, Connected, Connecting }; enum class ShouldBlock { No = 0, Yes = 1 }; class FileDescriptor; diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index ea03e9d62d..274cacd851 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -1140,11 +1140,11 @@ int Process::sys$pipe(int pipefd[2]) auto fifo = FIFO::create(m_uid); int reader_fd = alloc_fd(); - m_fds[reader_fd].set(fifo->open_direction(FIFO::Reader)); + m_fds[reader_fd].set(fifo->open_direction(FIFO::Direction::Reader)); pipefd[0] = reader_fd; int writer_fd = alloc_fd(); - m_fds[writer_fd].set(fifo->open_direction(FIFO::Writer)); + m_fds[writer_fd].set(fifo->open_direction(FIFO::Direction::Writer)); pipefd[1] = writer_fd; return 0; |