errno-list: prefer strerrorname_np() as errno_to_name() provider

This commit is contained in:
Mike Yuan
2025-01-02 12:01:53 +01:00
committed by Lennart Poettering
parent 89c4fe6c21
commit 03ccee1939
5 changed files with 22 additions and 1 deletions
+3
View File
@@ -10,6 +10,8 @@ static const struct errno_name* lookup_errno(register const char *str,
register GPERF_LEN_TYPE len);
#include "errno-from-name.h"
#if !HAVE_STRERRORNAME_NP
#include "errno-to-name.h"
const char* errno_to_name(int id) {
@@ -22,6 +24,7 @@ const char* errno_to_name(int id) {
return errno_names[id];
}
#endif
int errno_from_name(const char *name) {
const struct errno_name *sc;