From 1036949d6618b78b67f254dd73f10be158f49cb8 Mon Sep 17 00:00:00 2001 From: Antoine Busque Date: Thu, 21 Apr 2016 01:02:27 -0400 Subject: [PATCH] Use printf_debug/verbose in so-info MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Antoine Busque Signed-off-by: Jérémie Galarneau --- lib/Makefile.am | 1 + lib/so-info.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/Makefile.am b/lib/Makefile.am index d878e5fa..1587af89 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -22,6 +22,7 @@ libdebuginfo_la_SOURCES = debuginfo.c \ crc32.c \ utils.c libdebuginfo_la_LDFLAGS = -lelf -ldw +libdebuginfo_la_LIBADD = libbabeltrace.la endif libbabeltrace_la_LIBADD = \ diff --git a/lib/so-info.c b/lib/so-info.c index 239320d9..a5c38604 100644 --- a/lib/so-info.c +++ b/lib/so-info.c @@ -55,8 +55,8 @@ int so_info_init(void) int ret = 0; if (elf_version(EV_CURRENT) == EV_NONE) { - fprintf(stderr, "ELF library initialization failed: %s\n", - elf_errmsg(-1)); + printf_debug("ELF library initialization failed: %s\n", + elf_errmsg(-1)); ret = -1; } @@ -492,18 +492,18 @@ int so_info_set_elf_file(struct so_info *so) elf_fd = open(so->elf_path, O_RDONLY); if (elf_fd < 0) { - fprintf(stderr, "Failed to open %s\n", so->elf_path); + printf_verbose("Failed to open %s\n", so->elf_path); goto error; } elf_file = elf_begin(elf_fd, ELF_C_READ, NULL); if (!elf_file) { - fprintf(stderr, "elf_begin failed: %s\n", elf_errmsg(-1)); + printf_debug("elf_begin failed: %s\n", elf_errmsg(-1)); goto error; } if (elf_kind(elf_file) != ELF_K_ELF) { - fprintf(stderr, "Error: %s is not an ELF object\n", + printf_verbose("Error: %s is not an ELF object\n", so->elf_path); goto error; } -- 2.34.1