From 937802964ca32975e76ce7d3a35054d7dc321feb Mon Sep 17 00:00:00 2001 From: apio Date: Thu, 23 Mar 2023 21:34:38 +0100 Subject: [PATCH] kernel: Invert O_NONBLOCK to check whether a thread should block --- kernel/src/thread/Thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/thread/Thread.cpp b/kernel/src/thread/Thread.cpp index 8a44df98..93e08a2b 100644 --- a/kernel/src/thread/Thread.cpp +++ b/kernel/src/thread/Thread.cpp @@ -52,7 +52,7 @@ bool FileDescriptor::should_append() bool FileDescriptor::should_block() { - return flags & O_NONBLOCK; + return !(flags & O_NONBLOCK); } bool FileDescriptor::is_readable()