aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/tools/ctf/common
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-04-21 14:49:22 +0000
committerMark Johnston <markj@FreeBSD.org>2022-04-21 15:18:53 +0000
commit45dd2eaac379e5576f745380260470204c49beac (patch)
treeb938d4a9a8f44fd7456d0f17dc331c9cb58903c6 /cddl/contrib/opensolaris/tools/ctf/common
parentcda31e734925346328fd2369585ab3f6767ec225 (diff)
downloadsrc-45dd2eaac379e5576f745380260470204c49beac.tar.gz
src-45dd2eaac379e5576f745380260470204c49beac.zip
ctfdump: Remove definitions of warn() and vwarn()
The presence of the latter causes a link error when building a statically linked ctfdump(1) because libc defines the same symbol. libc's warn() is defined as a weak symbol and so does not cause the same problem, but let's just use libc's version. Reported by: stephane rochoy <stephane.rochoy@stormshield.eu> MFC after: 1 week Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'cddl/contrib/opensolaris/tools/ctf/common')
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/common/utils.c28
-rw-r--r--cddl/contrib/opensolaris/tools/ctf/common/utils.h2
2 files changed, 1 insertions, 29 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/common/utils.c b/cddl/contrib/opensolaris/tools/ctf/common/utils.c
index b9db1a870165..f74eb8de40fa 100644
--- a/cddl/contrib/opensolaris/tools/ctf/common/utils.c
+++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.c
@@ -24,8 +24,7 @@
* All rights reserved.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
+#include <err.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
@@ -61,31 +60,6 @@ getpname(void)
}
void
-vwarn(const char *format, va_list alist)
-{
- int err = errno;
-
- if (pname != NULL)
- (void) fprintf(stderr, "%s: ", pname);
-
- (void) vfprintf(stderr, format, alist);
-
- if (strchr(format, '\n') == NULL)
- (void) fprintf(stderr, ": %s\n", strerror(err));
-}
-
-/*PRINTFLIKE1*/
-void
-warn(const char *format, ...)
-{
- va_list alist;
-
- va_start(alist, format);
- vwarn(format, alist);
- va_end(alist);
-}
-
-void
vdie(const char *format, va_list alist)
{
vwarn(format, alist);
diff --git a/cddl/contrib/opensolaris/tools/ctf/common/utils.h b/cddl/contrib/opensolaris/tools/ctf/common/utils.h
index 9b07361a53ab..99378bb4f251 100644
--- a/cddl/contrib/opensolaris/tools/ctf/common/utils.h
+++ b/cddl/contrib/opensolaris/tools/ctf/common/utils.h
@@ -39,8 +39,6 @@ extern "C" {
#define E_ERROR 1 /* Exit status for error */
#define E_USAGE 2 /* Exit status for usage error */
-extern void vwarn(const char *, va_list);
-extern void warn(const char *, ...);
extern void vdie(const char *, va_list);
extern void die(const char *, ...);