Systemd/src/libsystemd
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-bus basic/capability-util: let cap_last_cap() return unsigned integer 2020-07-10 16:55:24 +02:00
sd-daemon tree-wide: port to fd_wait_for_event() 2020-06-10 20:06:10 +02:00
sd-device tree-wide: use SYNTHETIC_ERRNO with log_device_* in more places 2020-07-16 22:08:12 +02:00
sd-event tree-wide: use set_ensure_put() 2020-06-22 16:32:37 +02:00
sd-hwdb hwdb: optimize isatty()-per-line away 2020-04-13 11:27:35 +02:00
sd-id128 id128: move make_v4_uuid into id128-util.h to make it generally useful 2020-01-20 17:42:03 +01:00
sd-login sd-login: get rid of seat_can_multi_session() 2020-04-17 16:15:30 +02:00
sd-netlink network: add support for MACVLAN source mode 2020-07-08 18:01:52 +02:00
sd-network sd-network: drop unused functions 2020-06-23 19:13:05 +09:00
sd-path sd-path: drop "-dir" and "-path" suffixes from path enums 2020-05-28 23:54:35 +02:00
sd-resolve tree-wide: drop socket.h when socket-util.h is included 2019-11-04 00:30:32 +09:00
sd-utf8 tree-wide: drop empty comments 2018-06-29 11:00:30 +09:00
disable-mempool.c mempool: only enable mempool use when linked to libsystemd-shared.so 2018-10-11 11:10:37 +02:00
libsystemd.pc.in meson: define PROJECT_VERSION as the "bare" project version 2018-12-20 21:35:29 +01:00
libsystemd.sym sd-journal: when enumerating, continue even after an inaccessible field 2020-07-21 17:42:11 +02:00
meson.build sd-netlink: save dynamic general netlink message type 2019-10-15 01:57:19 +09:00