diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/err.c | 6 | ||||
-rw-r--r-- | lib/libc/gen/initgroups.c | 9 | ||||
-rw-r--r-- | lib/libc/include/namespace.h | 10 | ||||
-rw-r--r-- | lib/libc/include/un-namespace.h | 2 | ||||
-rw-r--r-- | lib/libc/rpc/svc_run.c | 2 |
5 files changed, 26 insertions, 3 deletions
diff --git a/lib/libc/gen/err.c b/lib/libc/gen/err.c index 6d1766c..528fa86 100644 --- a/lib/libc/gen/err.c +++ b/lib/libc/gen/err.c @@ -37,7 +37,9 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* LIBC_RCS and not lint */ +#include "namespace.h" #include <err.h> +#include "un-namespace.h" #include <errno.h> #include <stdio.h> #include <stdlib.h> @@ -143,8 +145,10 @@ verrx(eval, fmt, ap) exit(eval); } +__weak_reference(_warn, warn); + void -warn(const char *fmt, ...) +_warn(const char *fmt, ...) { va_list ap; va_start(ap, fmt); diff --git a/lib/libc/gen/initgroups.c b/lib/libc/gen/initgroups.c index b1ddd86..9918955 100644 --- a/lib/libc/gen/initgroups.c +++ b/lib/libc/gen/initgroups.c @@ -32,13 +32,20 @@ */ #if defined(LIBC_SCCS) && !defined(lint) +#if 0 static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93"; +#else +static const char rcsid[] = + "$FreeBSD$"; +#endif #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> #include <stdio.h> +#include "namespace.h" #include <err.h> +#include "un-namespace.h" #include <unistd.h> int @@ -53,7 +60,7 @@ initgroups(uname, agroup) warnx("%s is in too many groups, using first %d", uname, ngroups); if (setgroups(ngroups, groups) < 0) { - warn("setgroups"); + _warn("setgroups"); return (-1); } return (0); diff --git a/lib/libc/include/namespace.h b/lib/libc/include/namespace.h index 470243b..59143f6 100644 --- a/lib/libc/include/namespace.h +++ b/lib/libc/include/namespace.h @@ -31,6 +31,16 @@ #define _NAMESPACE_H_ /* + * Adjust names so that headers declare "hidden" names. + */ + +/* + * ISO C (C90) section. Most names in libc aren't in ISO C, so they + * should be here. Most aren't here... + */ +#define warn _warn + +/* * Prototypes for syscalls/functions that need to be overridden * in libc_r/libpthread. */ diff --git a/lib/libc/include/un-namespace.h b/lib/libc/include/un-namespace.h index c7a5724..9290a99 100644 --- a/lib/libc/include/un-namespace.h +++ b/lib/libc/include/un-namespace.h @@ -137,4 +137,6 @@ int _kevent(int, const struct kevent *, int, struct kevent *, int _flock(int, int); #endif +#undef warn + #endif /* _UN_NAMESPACE_H_ */ diff --git a/lib/libc/rpc/svc_run.c b/lib/libc/rpc/svc_run.c index 08f3776..f2adf56 100644 --- a/lib/libc/rpc/svc_run.c +++ b/lib/libc/rpc/svc_run.c @@ -68,7 +68,7 @@ svc_run() if (errno == EINTR) { continue; } - warn("svc_run: - select failed"); + _warn("svc_run: - select failed"); return; case 0: continue; |