Loading...
string/FreeBSD/strerror.c Libc-825.26 Libc-763.13
--- Libc/Libc-825.26/string/FreeBSD/strerror.c
+++ Libc/Libc-763.13/string/FreeBSD/strerror.c
@@ -52,13 +52,12 @@
  */
 #define	EBUFSIZE	(20 + 2 + sizeof(UPREFIX))
 
-#ifndef BUILDING_VARIANT
 /*
  * Doing this by hand instead of linking with stdio(3) avoids bloat for
  * statically linked binaries.
  */
-__private_extern__ void
-__errstr(int num, char *uprefix, char *buf, size_t len)
+static void
+errstr(int num, char *uprefix, char *buf, size_t len)
 {
 	char *t;
 	unsigned int uerr;
@@ -88,8 +87,8 @@
 	catd = catopen("libc", NL_CAT_LOCALE);
 #endif
 
-	if (errnum < 0 || errnum >= sys_nerr) {
-		__errstr(errnum,
+	if (errnum < 1 || errnum >= sys_nerr) {
+		errstr(errnum,
 #if defined(NLS)
 			catgets(catd, 1, 0xffff, UPREFIX),
 #else
@@ -115,20 +114,13 @@
 
 	return (retval);
 }
-#else /* BUILDING_VARIANT */
-__private_extern__ void __errstr(int, char *, size_t);
-#endif /* !BUILDING_VARIANT */
 
 char *
 strerror(int num)
 {
 	static char ebuf[NL_TEXTMAX];
 
-#if !__DARWIN_UNIX03
 	if (strerror_r(num, ebuf, sizeof(ebuf)) != 0)
 	errno = EINVAL;
-#else
-	(void)strerror_r(num, ebuf, sizeof(ebuf));
-#endif
 	return (ebuf);
 }