From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5426 invoked by alias); 16 Oct 2017 11:28:57 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 5402 invoked by uid 89); 16 Oct 2017 11:28:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.99.2 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=jiang, Jiang, Hx-languages-length:1370 X-Spam-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Oct 2017 11:28:55 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 4E2583000B9C; Mon, 16 Oct 2017 13:28:53 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 02A20419BB86; Mon, 16 Oct 2017 13:28:52 +0200 (CEST) From: Mark Wielaard To: elfutils-devel@sourceware.org Cc: Mark Wielaard Subject: [PATCH] libdwfl: When the kernel is found, but not the modules warn, don't fail. Date: Mon, 16 Oct 2017 11:28:00 -0000 Message-Id: <1508153331-8211-1-git-send-email-mark@klomp.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2017-q4/txt/msg00024.txt.bz2 For -k the argp parser could fail to find the modules after the kernel itself was already found. Calling failure at this point closes the Dwfl, which isn't necessary. Just warn about the missing modules and continue with the kernel only Dwfl. Signed-off-by: Mark Wielaard --- libdwfl/ChangeLog | 5 +++++ libdwfl/argp-std.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 2008c6a..112620f 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2017-10-16 Mark Wielaard + + * argp-std.c (parse_opt): For -k call argp_failure not failure to + keep dwfl around. + 2017-07-26 Yunlian Jiang * argp-std.c (failure): Move to file scope. diff --git a/libdwfl/argp-std.c b/libdwfl/argp-std.c index 498ace2..8ee9158 100644 --- a/libdwfl/argp-std.c +++ b/libdwfl/argp-std.c @@ -238,7 +238,7 @@ parse_opt (int key, char *arg, struct argp_state *state) result = INTUSE(dwfl_linux_kernel_report_modules) (dwfl); if (result != 0) /* Non-fatal to have no modules since we do have the kernel. */ - failure (dwfl, result, _("cannot find kernel modules"), state); + argp_failure (state, 0, result, _("cannot find kernel modules")); opt->dwfl = dwfl; } else -- 1.8.3.1