summaryrefslogtreecommitdiff
path: root/package/libnl/patches/patch-src_lib_utils_c
blob: 60117cbdce6abb29acc1ed9fbbb9adb69d11e669 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
--- libnl-libnl3_2_29.orig/src/lib/utils.c	Fri Dec 30 15:57:01 2016
+++ libnl-libnl3_2_29/src/lib/utils.c	Sat Jan 13 09:58:56 2024
@@ -81,6 +81,7 @@ void nl_cli_fatal(int err, const char *fmt, ...)
 		fprintf(stderr, "\n");
 	} else {
 		char *buf;
+#ifdef HAVE_STRERROR_L
 		locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0);
 		if (loc == (locale_t)0) {
 			if (errno == ENOENT)
@@ -91,9 +92,14 @@ void nl_cli_fatal(int err, const char *fmt, ...)
 		}
 		if (loc != (locale_t)0)
 			buf = strerror_l(err, loc);
+#else
+		buf = strerror(err);
+#endif
 		fprintf(stderr, "%s\n", buf);
+#ifdef HAVE_STRERROR_L
 		if (loc != (locale_t)0)
 			freelocale(loc);
+#endif
 	}
 
 	exit(abs(err));