Systemd/src/systemd
Zbigniew Jędrzejewski-Szmek 76cbafcdd4 sd-journal: when enumerating, continue even after an inaccessible field
SD_JOURNAL_FOREACH_DATA() and SD_JOURNAL_FOREACH_UNIQUE() would immediately
terminate when a field couldn't be accessed. This can happen for example when a
field is compressed with an unavailable compression format. But it's likely
that this is the wrong thing to do: the caller for example might want to
iterate over the fields but isn't interested in all of them. coredumpctl is
like this: it uses SD_JOURNAL_FOREACH_DATA() but only uses a subset of the
fields.

Add two new functions sd_journal_enumerate_good_data() and
sd_journal_enumerate_good_unique() that retry sd_journal_enumerate_data() and
sd_journal_enumerate_unique() if the return value is something that applies to
a single field: ENOBUS, E2BIG, EOPNOTSUPP.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1856037.

An alternative would be to make the macros themselves smarter instead of adding
new symbols, and do the looping internally in the macro. I don't like that
approach for two reasons. First, it would embed the logic in the macro, so
recompilation would be required if we decide to update the logic. With the
current version of the patch, recompilation is required to use the new symbols,
but after that, library upgrades are enough. So the current approach is safer
in case further updates are needed. Second, our headers use primitive C, and it
is hard to do the macros without using newer features.
2020-07-21 17:42:11 +02:00
..
_sd-common.h journal: properly mark two definitions that are deprecated with GCC attributes for that 2020-01-31 15:02:00 +01:00
meson.build sd-dhcp6: Introduce vendor specific information 2020-05-29 13:36:42 +02:00
sd-bus-protocol.h tree-wide: drop empty lines in the begining of comments 2018-06-29 10:50:23 +09:00
sd-bus-vtable.h sd-bus: introduce new SD_BUS_VTABLE_ABSOLUTE_OFFSET vtable flag 2020-05-13 16:57:44 +02:00
sd-bus.h sd-bus: make name validation functions public 2020-05-25 11:09:21 +02:00
sd-daemon.h Introduce sd_notify_barrier 2020-05-01 03:22:47 +05:30
sd-device.h sd-device: drop priority and description from sd_device_monitor_attach_event() and sd_device_monitor_start() 2018-11-10 22:53:00 +09:00
sd-dhcp-client.h sd-dhcp-client: add sd_dhcp_client_id_to_string() 2020-06-04 11:16:15 +02:00
sd-dhcp-lease.h sd-dhcp: clean-up of DHCP lease server code 2020-05-30 14:18:43 +02:00
sd-dhcp-option.h dhcp: remove struct sd_dhcp_raw_option 2019-11-18 23:37:22 +09:00
sd-dhcp-server.h network: clean-up DHCP lease server data configuration 2020-06-18 13:08:18 +09:00
sd-dhcp6-client.h network: DHCP6 - introduce DHCP6 DUID to string 2020-06-10 19:17:28 +02:00
sd-dhcp6-lease.h sd-dhcp6: constify output arguments in get_{ntp,nds}_addr 2020-05-26 09:47:45 +02:00
sd-dhcp6-option.h sd-dhcp6: Introduce vendor specific information 2020-05-29 13:36:42 +02:00
sd-event.h sd-event: add pidfd support 2019-12-04 10:34:41 +01:00
sd-hwdb.h tree-wide: drop copyright headers from frequent contributors 2018-06-20 11:58:53 +02:00
sd-id128.h tree-wide: drop duplicated blank lines 2019-07-15 18:41:27 +02:00
sd-ipv4acd.h ipv4ll: do not reset conflict counter on restart 2019-12-11 13:26:31 +09:00
sd-ipv4ll.h tree-wide: use proper unicode © instead of (C) where we can 2018-06-14 10:20:20 +02:00
sd-journal.h sd-journal: when enumerating, continue even after an inaccessible field 2020-07-21 17:42:11 +02:00
sd-lldp.h all: fix minor typos 2020-07-07 18:52:49 +09:00
sd-login.h sd-login: get rid of seat_can_multi_session() 2020-04-17 16:15:30 +02:00
sd-messages.h udevadm: beef up deprecation log warning 2020-07-14 14:57:19 +02:00
sd-ndisc.h tree-wide: fix spelling errors 2020-04-21 23:21:08 +02:00
sd-netlink.h sd-netlink: introduce sd_netlink_message_append_s8() and friends 2020-03-02 15:59:32 +09:00
sd-network.h sd-network: drop unused functions 2020-06-23 19:13:05 +09:00
sd-path.h sd-path: drop "-dir" and "-path" suffixes from path enums 2020-05-28 23:54:35 +02:00
sd-radv.h Revert "network: Don't send RA with zero router lifetime when restarting radv" 2020-07-07 11:06:08 +09:00
sd-resolve.h tree-wide: add whitespace between type and variable name 2018-12-04 09:29:54 +01:00
sd-utf8.h tree-wide: drop empty lines in the begining of comments 2018-06-29 10:50:23 +09:00