diff options
Diffstat (limited to 'AK')
-rw-r--r-- | AK/Error.h | 2 | ||||
-rw-r--r-- | AK/Stream.cpp | 14 |
2 files changed, 3 insertions, 13 deletions
diff --git a/AK/Error.h b/AK/Error.h index 302de1cf3c..02eccaf5ca 100644 --- a/AK/Error.h +++ b/AK/Error.h @@ -76,11 +76,11 @@ public: } int code() const { return m_code; } -#ifndef KERNEL bool is_errno() const { return m_code != 0; } +#ifndef KERNEL bool is_syscall() const { return m_syscall; diff --git a/AK/Stream.cpp b/AK/Stream.cpp index 2b0ae90da2..c47afe3dbf 100644 --- a/AK/Stream.cpp +++ b/AK/Stream.cpp @@ -20,15 +20,10 @@ ErrorOr<void> Stream::read_entire_buffer(Bytes buffer) auto result = read(buffer.slice(nread)); if (result.is_error()) { -#ifdef KERNEL - if (result.error().code() == EINTR) { - continue; - } -#else if (result.error().is_errno() && result.error().code() == EINTR) { continue; } -#endif + return result.release_error(); } @@ -89,15 +84,10 @@ ErrorOr<void> Stream::write_entire_buffer(ReadonlyBytes buffer) while (nwritten < buffer.size()) { auto result = write(buffer.slice(nwritten)); if (result.is_error()) { -#ifdef KERNEL - if (result.error().code() == EINTR) { - continue; - } -#else if (result.error().is_errno() && result.error().code() == EINTR) { continue; } -#endif + return result.release_error(); } |