about summary refs log tree commit diff
path: root/stdio-common/errlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/errlist.c')
-rw-r--r--stdio-common/errlist.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/stdio-common/errlist.c b/stdio-common/errlist.c
index 1c09a31a7a..4c0a0a218d 100644
--- a/stdio-common/errlist.c
+++ b/stdio-common/errlist.c
@@ -16,29 +16,17 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include <stdio.h>
+#include <array_length.h>
+#include <err_map.h>
 #include <errno.h>
 #include <libintl.h>
-#include <array_length.h>
-
-#ifndef ERR_MAP
-# define ERR_MAP(n) n
-#endif
-
-const char *const _sys_errlist_internal[] =
-  {
-#define _S(n, str)         [ERR_MAP(n)] = str,
-#include <errlist.h>
-#undef _S
-  };
+#include <stdio.h>
 
 const char *
 __get_errlist (int errnum)
 {
   int mapped = ERR_MAP (errnum);
-  if (mapped >= 0 && mapped < array_length (_sys_errlist_internal))
+  if (mapped >= 0 && mapped < _sys_errlist_internal_len)
     return _sys_errlist_internal[mapped];
   return NULL;
 }
-
-#include <errlist-compat.c>