summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/gen/err.c4
-rw-r--r--lib/libc/gen/stringlist.c11
-rw-r--r--lib/libc/include/namespace.h1
-rw-r--r--lib/libc/include/un-namespace.h1
-rw-r--r--lib/libc/net/nsdispatch.c4
-rw-r--r--lib/libc/net/nslexer.l3
6 files changed, 17 insertions, 7 deletions
diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c
index 528fa86..fd4135b 100644
--- a/lib/libc/gen/err.c
+++ b/lib/libc/gen/err.c
@@ -72,8 +72,10 @@ err_set_exit(void (*ef)(int))
err_exit = ef;
}
+__weak_reference(_err, err);
+
void
-err(int eval, const char *fmt, ...)
+_err(int eval, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
diff --git a/lib/libc/gen/stringlist.c b/lib/libc/gen/stringlist.c
index bb74919..abe4e00 100644
--- a/lib/libc/gen/stringlist.c
+++ b/lib/libc/gen/stringlist.c
@@ -31,9 +31,14 @@
* SUCH DAMAGE.
*/
+#if 0
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$NetBSD: stringlist.c,v 1.2 1997/01/17 07:26:20 lukem Exp $";
#endif /* LIBC_SCCS and not lint */
+#endif
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include <stdio.h>
#include <string.h>
@@ -51,13 +56,13 @@ sl_init()
{
StringList *sl = malloc(sizeof(StringList));
if (sl == NULL)
- err(1, "stringlist: %m");
+ _err(1, "stringlist: %m");
sl->sl_cur = 0;
sl->sl_max = _SL_CHUNKSIZE;
sl->sl_str = malloc(sl->sl_max * sizeof(char *));
if (sl->sl_str == NULL)
- err(1, "stringlist: %m");
+ _err(1, "stringlist: %m");
return sl;
}
@@ -74,7 +79,7 @@ sl_add(sl, name)
sl->sl_max += _SL_CHUNKSIZE;
sl->sl_str = reallocf(sl->sl_str, sl->sl_max * sizeof(char *));
if (sl->sl_str == NULL)
- err(1, "stringlist: %m");
+ _err(1, "stringlist: %m");
}
sl->sl_str[sl->sl_cur++] = name;
}
diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h
index 9d01520..68babbe 100644
--- a/lib/libc/include/namespace.h
+++ b/lib/libc/include/namespace.h
@@ -38,6 +38,7 @@
* ISO C (C90) section. Most names in libc aren't in ISO C, so they
* should be here. Most aren't here...
*/
+#define err _err
#define warn _warn
/*
diff --git a/lib/libc/include/un-namespace.h b/lib/libc/include/un-namespace.h
index 21f099c..855c101 100644
--- a/lib/libc/include/un-namespace.h
+++ b/lib/libc/include/un-namespace.h
@@ -136,6 +136,7 @@ int _kevent(int, const struct kevent *, int, struct kevent *,
int _flock(int, int);
#endif
+#undef err
#undef warn
#endif /* _UN_NAMESPACE_H_ */
diff --git a/lib/libc/net/nsdispatch.c b/lib/libc/net/nsdispatch.c
index 311b89d..166db77 100644
--- a/lib/libc/net/nsdispatch.c
+++ b/lib/libc/net/nsdispatch.c
@@ -95,7 +95,7 @@ _nsdbtaddsrc(dbt, src)
dbt->srclist = (ns_src *)realloc(dbt->srclist,
(dbt->srclistsize + NSELEMSPERCHUNK) * sizeof(ns_src));
if (dbt->srclist == NULL)
- err(1, "nsdispatch: memory allocation failure");
+ _err(1, "nsdispatch: memory allocation failure");
}
memmove(&dbt->srclist[dbt->srclistsize++], src, sizeof(ns_src));
}
@@ -208,7 +208,7 @@ _nsdbtput(dbt)
_nsmap = (ns_dbt *)realloc(_nsmap,
(_nsmapsize + NSELEMSPERCHUNK) * sizeof(ns_dbt));
if (_nsmap == NULL)
- err(1, "nsdispatch: memory allocation failure");
+ _err(1, "nsdispatch: memory allocation failure");
}
memmove(&_nsmap[_nsmapsize++], dbt, sizeof(ns_dbt));
}
diff --git a/lib/libc/net/nslexer.l b/lib/libc/net/nslexer.l
index 1166eed..5fa159e 100644
--- a/lib/libc/net/nslexer.l
+++ b/lib/libc/net/nslexer.l
@@ -84,7 +84,8 @@ STRING [a-zA-Z][a-zA-Z0-9_]*
int i;
if ((p = strdup(yytext)) == NULL)
- err(1, "nsdispatch: memory allocation failure");
+ _err(1,
+ "nsdispatch: memory allocation failure");
for (i = 0; i < strlen(p); i++) {
if (isupper((unsigned char)p[i]))
OpenPOWER on IntegriCloud