1 --- strerror.c.orig 2010-10-07 16:06:39.000000000 -0700
2 +++ strerror.c 2010-10-07 16:17:59.000000000 -0700
3 @@ -52,12 +52,13 @@ __FBSDID("$FreeBSD: src/lib/libc/string/
5 #define EBUFSIZE (20 + 2 + sizeof(UPREFIX))
7 +#ifndef BUILDING_VARIANT
9 * Doing this by hand instead of linking with stdio(3) avoids bloat for
10 * statically linked binaries.
13 -errstr(int num, char *uprefix, char *buf, size_t len)
14 +__private_extern__ void
15 +__errstr(int num, char *uprefix, char *buf, size_t len)
19 @@ -87,8 +88,8 @@ strerror_r(int errnum, char *strerrbuf,
20 catd = catopen("libc", NL_CAT_LOCALE);
23 - if (errnum < 1 || errnum >= sys_nerr) {
25 + if (errnum < 0 || errnum >= sys_nerr) {
28 catgets(catd, 1, 0xffff, UPREFIX),
30 @@ -114,13 +115,20 @@ strerror_r(int errnum, char *strerrbuf,
34 +#else /* BUILDING_VARIANT */
35 +__private_extern__ void __errstr(int, char *, size_t);
36 +#endif /* !BUILDING_VARIANT */
41 static char ebuf[NL_TEXTMAX];
44 if (strerror_r(num, ebuf, sizeof(ebuf)) != 0)
47 + (void)strerror_r(num, ebuf, sizeof(ebuf));