public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libdwfl: When the kernel is found, but not the modules warn, don't fail.
@ 2017-10-16 11:28 Mark Wielaard
  2017-10-20 12:01 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2017-10-16 11:28 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

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 <mark@klomp.org>
---
 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  <mark@klomp.org>
+
+	* argp-std.c (parse_opt): For -k call argp_failure not failure to
+	keep dwfl around.
+
 2017-07-26  Yunlian Jiang  <yunlian@google.com>
 
 	* 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libdwfl: When the kernel is found, but not the modules warn, don't fail.
  2017-10-16 11:28 [PATCH] libdwfl: When the kernel is found, but not the modules warn, don't fail Mark Wielaard
@ 2017-10-20 12:01 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2017-10-20 12:01 UTC (permalink / raw)
  To: elfutils-devel

On Mon, 2017-10-16 at 13:28 +0200, Mark Wielaard wrote:
> 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.

I pushed this to master.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-20 12:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 11:28 [PATCH] libdwfl: When the kernel is found, but not the modules warn, don't fail Mark Wielaard
2017-10-20 12:01 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).