From 1850d0d271e30120dff0456e0bc41cc39ab339c2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 11 Nov 2017 21:26:10 +0900 Subject: [PATCH] basic/errno-list: remove errno_max() and define ERRNO_MAX as 4095 In Linux kernel code, MAX_ERRNO is defined as 4095. Here, we use that value for ERRNO_MAX. --- src/basic/errno-list.c | 4 ---- src/basic/errno-list.h | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index c6a01ee..f0b7475 100644 --- a/src/basic/errno-list.c +++ b/src/basic/errno-list.c @@ -51,7 +51,3 @@ int errno_from_name(const char *name) { assert(sc->id > 0); return sc->id; } - -int errno_max(void) { - return ELEMENTSOF(errno_names); -} diff --git a/src/basic/errno-list.h b/src/basic/errno-list.h index 4eec0cc..c8e5205 100644 --- a/src/basic/errno-list.h +++ b/src/basic/errno-list.h @@ -19,7 +19,11 @@ along with systemd; If not, see . ***/ +/* + * MAX_ERRNO is defined as 4095 in linux/err.h + * We use the same value here. + */ +#define ERRNO_MAX 4095 + const char *errno_to_name(int id); int errno_from_name(const char *name); - -int errno_max(void); -- 2.7.4