diff options
author | Tom <tomut@yahoo.com> | 2020-07-06 17:10:52 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-07 15:46:58 +0200 |
commit | 419703a1f23509cde3e386e6f918141f320cfc48 (patch) | |
tree | c818ec9cbc57f36ca40203010a3a35c65b6a412e /Kernel/FileSystem/Plan9FileSystem.cpp | |
parent | 1493dd9dc628c4fceb005109b01b24605f6b22af (diff) | |
download | serenity-419703a1f23509cde3e386e6f918141f320cfc48.zip |
Kernel: Fix checking BlockResult
We now have BlockResult::WokeNormally and BlockResult::NotBlocked,
both of which indicate no error. We can no longer just check for
BlockResult::WokeNormally and assume anything else must be an
interruption.
Diffstat (limited to 'Kernel/FileSystem/Plan9FileSystem.cpp')
-rw-r--r-- | Kernel/FileSystem/Plan9FileSystem.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Kernel/FileSystem/Plan9FileSystem.cpp b/Kernel/FileSystem/Plan9FileSystem.cpp index 94ac878f58..aa5bc2c4ba 100644 --- a/Kernel/FileSystem/Plan9FileSystem.cpp +++ b/Kernel/FileSystem/Plan9FileSystem.cpp @@ -423,7 +423,7 @@ KResult Plan9FS::post_message(Message& message) while (size > 0) { if (!description.can_write()) { - if (Thread::current()->block<Thread::WriteBlocker>(description) != Thread::BlockResult::WokeNormally) + if (Thread::current()->block<Thread::WriteBlocker>(description).was_interrupted()) return KResult(-EINTR); } ssize_t nwritten = description.write(data, size); @@ -441,7 +441,7 @@ KResult Plan9FS::do_read(u8* data, size_t size) auto& description = file_description(); while (size > 0) { if (!description.can_read()) { - if (Thread::current()->block<Thread::ReadBlocker>(description) != Thread::BlockResult::WokeNormally) + if (Thread::current()->block<Thread::ReadBlocker>(description).was_interrupted()) return KResult(-EINTR); } ssize_t nread = description.read(data, size); @@ -524,8 +524,7 @@ KResult Plan9FS::wait_for_specific_message(u16 tag, Message& out_message) // Block until either: // * Someone else reads the message we're waiting for, and hands it to us; // * Or we become the one to read and dispatch messages. - auto block_result = Thread::current()->block<Plan9FS::Blocker>(completion); - if (block_result != Thread::BlockResult::WokeNormally) { + if (Thread::current()->block<Plan9FS::Blocker>(completion).was_interrupted()) { LOCKER(m_lock); m_completions.remove(tag); return KResult(-EINTR); |