From c06d5ef114a385944289d8c6a849bf34e544fe55 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 10 Apr 2020 12:58:27 +0200 Subject: [PATCH] Kernel+LibC: Remove ESUCCESS There's no official ESUCCESS==0 errno code, and it keeps breaking the Lagom build when we use it, so let's just say 0 instead. --- Kernel/KResult.h | 2 +- Kernel/Process.cpp | 4 ++-- Libraries/LibC/errno_numbers.h | 1 - Libraries/LibLine/Editor.cpp | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Kernel/KResult.h b/Kernel/KResult.h index b4f1938b18e..12c974d1723 100644 --- a/Kernel/KResult.h +++ b/Kernel/KResult.h @@ -49,7 +49,7 @@ public: operator int() const { return m_error; } int error() const { return m_error; } - bool is_success() const { return m_error == ESUCCESS; } + bool is_success() const { return m_error == 0; } bool is_error() const { return !is_success(); } private: diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 230be187bed..c2ff7e291ab 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -3978,7 +3978,7 @@ int Process::sys$halt() dbg() << "attempting system shutdown..."; IO::out16(0x604, 0x2000); - return ESUCCESS; + return 0; } int Process::sys$reboot() @@ -3998,7 +3998,7 @@ int Process::sys$reboot() dbg() << "attempting reboot via KB Controller..."; IO::out8(0x64, 0xFE); - return ESUCCESS; + return 0; } int Process::sys$mount(const Syscall::SC_mount_params* user_params) diff --git a/Libraries/LibC/errno_numbers.h b/Libraries/LibC/errno_numbers.h index e42eaebea9b..c805cf29858 100644 --- a/Libraries/LibC/errno_numbers.h +++ b/Libraries/LibC/errno_numbers.h @@ -26,7 +26,6 @@ #pragma once -#define ESUCCESS 0 #define EPERM 1 #define ENOENT 2 #define ESRCH 3 diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index 37f9671a0a5..58413ba4c4e 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -654,7 +654,7 @@ Vector Editor::vt_dsr() do { auto nread = read(0, buf + length, 16 - length); if (nread < 0) { - if (errno == ESUCCESS) { + if (errno == 0) { // ???? continue; }