From a9f488c55b238f07c376d223832575ac3fedae70 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 30 Apr 2021 12:10:09 +0200 Subject: [PATCH] LibC: Make EWOULDBLOCK an alias for EAGAIN According to POSIX.1 all error codes have to be distinct - with the exception for EAGAIN and EWOULDBLOCK. Other libcs including eglibc and newlib define EWOULDBLOCK as an alias for EAGAIN and some software including OpenTTD expect this behavior. --- Userland/Libraries/LibC/errno_numbers.h | 4 ++-- Userland/Libraries/LibC/string.cpp | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibC/errno_numbers.h b/Userland/Libraries/LibC/errno_numbers.h index 75254037d3e05f..8c9f73865ffd3a 100644 --- a/Userland/Libraries/LibC/errno_numbers.h +++ b/Userland/Libraries/LibC/errno_numbers.h @@ -133,8 +133,6 @@ enum ErrnoCode { #define ENOPROTOOPT ENOPROTOOPT ENOTCONN, #define ENOTCONN ENOTCONN - EWOULDBLOCK, -#define EWOULDBLOCK EWOULDBLOCK EPROTONOSUPPORT, #define EPROTONOSUPPORT EPROTONOSUPPORT EDEADLK, @@ -158,3 +156,5 @@ enum ErrnoCode { EMAXERRNO, #define EMAXERRNO EMAXERRNO }; + +#define EWOULDBLOCK EAGAIN diff --git a/Userland/Libraries/LibC/string.cpp b/Userland/Libraries/LibC/string.cpp index 24ecc430072c73..04021f98110e67 100644 --- a/Userland/Libraries/LibC/string.cpp +++ b/Userland/Libraries/LibC/string.cpp @@ -338,7 +338,6 @@ const char* const sys_errlist[] = { "No message", "No protocol option", "Not connected", - "Operation would block", "Protocol not supported", "Resource deadlock would occur", "Timed out",