tcp_wrappers/tcp_wrappers-7.6-strerror.patch
Silvan Calarco 82b31e57e6 added shared_lib_plus_plus patch for dynamic library and build fixes for other packages
use Makefile for install, remove specfile code
created libwrap and libwrap-devel (obsoleting tcp_wrappers-devel) [release 7.6-4mamba;Fri Sep 21 2007]
2024-01-05 18:21:34 +01:00

28 lines
630 B
Diff

--- tcp-wrappers-7.6/percent_m.c
+++ tcp-wrappers-7.6/percent_m.c
@@ -13,7 +13,7 @@
#include <string.h>
extern int errno;
-#ifndef SYS_ERRLIST_DEFINED
+#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
extern char *sys_errlist[];
extern int sys_nerr;
#endif
@@ -29,11 +29,15 @@
while (*bp = *cp)
if (*cp == '%' && cp[1] == 'm') {
+#ifdef HAVE_STRERROR
+ strcpy(bp, strerror(errno));
+#else
if (errno < sys_nerr && errno > 0) {
strcpy(bp, sys_errlist[errno]);
} else {
sprintf(bp, "Unknown error %d", errno);
}
+#endif
bp += strlen(bp);
cp += 2;
} else {