From 020433dd3d611d547fcdd19861a2e124a4241236 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sun, 16 Aug 2020 16:58:30 +0900 Subject: [PATCH] libc: Add definition for ENOTDIR --- include/corax/errno.h | 1 + libc/string.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/corax/errno.h b/include/corax/errno.h index 1868dc5..d8c5556 100644 --- a/include/corax/errno.h +++ b/include/corax/errno.h @@ -41,5 +41,6 @@ #define EINTR 20 #define EOVERFLOW 21 #define ECONNREFUSED 22 +#define ENOTDIR 23 #endif /* __CORAX_ERRNO_H */ diff --git a/libc/string.c b/libc/string.c index 566a222..ccc7a09 100644 --- a/libc/string.c +++ b/libc/string.c @@ -48,13 +48,14 @@ static const char *_errno_str[] = { "EINTR", "EOVERFLOW", "ECONNREFUSED", + "ENOTDIR", NULL }; const char *strerror(int err) { - if(err < 0 || err > ECONNREFUSED) { - err = ECONNREFUSED + 1; + if(err < 0 || err > ENOTDIR) { + err = ENOTDIR + 1; } return(_errno_str[err]); -- 2.47.3