summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2001-11-11 02:48:09 +0000
committerbde <bde@FreeBSD.org>2001-11-11 02:48:09 +0000
commiteb58f0f1a85857ed4be993a454e8aafed1b43b58 (patch)
tree9f56244d965dec1345589fb1aa8b7b147549c0dd /lib/libc/gen
parentfdac350c9d2806675dca447df23111492108d0b9 (diff)
downloadFreeBSD-src-eb58f0f1a85857ed4be993a454e8aafed1b43b58.zip
FreeBSD-src-eb58f0f1a85857ed4be993a454e8aafed1b43b58.tar.gz
Fixed namespace pollution related to `err' in libc in the same way as for
`warn'. Now a whole 2 members of the err() family don't cause pollution. This fixes world breakage in awk for NOSHARED worlds. contrib/awk/msg.c has had its own version of err() for a long time, but this somehow didn't cause problems until the update to awk-3.1.0.
Diffstat (limited to 'lib/libc/gen')
-rw-r--r--lib/libc/gen/err.c4
-rw-r--r--lib/libc/gen/stringlist.c11
2 files changed, 11 insertions, 4 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;
}
OpenPOWER on IntegriCloud