have_strerror

Gbp-Pq: Name have_strerror
This commit is contained in:
Marco d'Itri 2022-05-14 02:57:49 +08:00 committed by openKylinBot
parent ecf48b3a04
commit 8976aa425a
1 changed files with 4 additions and 0 deletions

View File

@ -29,11 +29,15 @@ char *ibuf;
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 {