]> git.pld-linux.org Git - packages/tcp_wrappers.git/blame - tcp_wrappers-strerror.patch
- rel 44; fix path to symlink
[packages/tcp_wrappers.git] / tcp_wrappers-strerror.patch
CommitLineData
e2fe8fdc
JR
1- don't use sys_errlist, use strerror
2--- tcp-wrappers-7.6/percent_m.c
3+++ tcp-wrappers-7.6/percent_m.c
4@@ -13,7 +13,7 @@
5 #include <string.h>
6
7 extern int errno;
8-#ifndef SYS_ERRLIST_DEFINED
9+#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
10 extern char *sys_errlist[];
11 extern int sys_nerr;
12 #endif
13@@ -29,11 +29,15 @@
14
15 while (*bp = *cp)
16 if (*cp == '%' && cp[1] == 'm') {
17+#ifdef HAVE_STRERROR
18+ strcpy(bp, strerror(errno));
19+#else
20 if (errno < sys_nerr && errno > 0) {
21 strcpy(bp, sys_errlist[errno]);
22 } else {
23 sprintf(bp, "Unknown error %d", errno);
24 }
25+#endif
26 bp += strlen(bp);
27 cp += 2;
28 } else {
This page took 0.058192 seconds and 4 git commands to generate.