]> git.ipfire.org Git - thirdparty/systemd.git/commit
coredumpctl: tighten print_field() code
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 27 Sep 2016 08:52:10 +0000 (10:52 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 28 Sep 2016 21:49:01 +0000 (23:49 +0200)
commit062b99e8be63ba49b80d988da9b00a1d39255496
treed54288a43cc1a71af9bbc24fdaa2e77f19fcf7db
parent04de587942054c414beda54af303880851b0fa4c
coredumpctl: tighten print_field() code

Propagate errors properly, so that if we hit oom or an error in the
journal, the whole command will fail. This is important when using
the output in scripts.

Support the output of multiple values for the same field with -F.
The journal supports that, and our official commands should too, as
far as it makes sense. -F can be used to print user-defined fields
(e.g. somebody could use a TAG field with multiple occurences), so
we should support that too. That seems better than silently printing
the last value found as was done before.

We would iterate trying to match the same field with all possible
field names. Once we find something, cut the loop short, since we
know that nothing else can match.
src/coredump/coredumpctl.c