summaryrefslogtreecommitdiffstats
path: root/src/shared/logs-show.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-02 09:16:16 +0200
committerLennart Poettering <lennart@poettering.net>2023-05-02 12:17:41 +0200
commita3b076f641fab2989745ee057e3576f970e0eff6 (patch)
tree61bbf2c643b48d9a71a306e91ac91eabdd66da8a /src/shared/logs-show.c
parentdocs: add correct `pacman` command (#27486) (diff)
downloadsystemd-a3b076f641fab2989745ee057e3576f970e0eff6.tar.xz
systemd-a3b076f641fab2989745ee057e3576f970e0eff6.zip
tree-wide: Handle EADDRNOTAVAIL as journal corruption
Journal corruption is not only indicated by EBADMSG but also by EADDRNOTAVAIL so treat that as corruption in a few more cases.
Diffstat (limited to 'src/shared/logs-show.c')
-rw-r--r--src/shared/logs-show.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index d372e096c4..539d3963de 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -509,7 +509,7 @@ static int output_short(
if (r < 0)
return r;
}
- if (r == -EBADMSG) {
+ if (IN_SET(r, -EBADMSG, -EADDRNOTAVAIL)) {
log_debug_errno(r, "Skipping message we can't read: %m");
return 0;
}
@@ -868,7 +868,7 @@ static int output_export(
fputc('\n', f);
}
- if (r == -EBADMSG) {
+ if (IN_SET(r, -EADDRNOTAVAIL, -EBADMSG)) {
log_debug_errno(r, "Skipping message we can't read: %m");
return 0;
}
@@ -1116,7 +1116,7 @@ static int output_json(
size_t size;
r = sd_journal_enumerate_data(j, &data, &size);
- if (r == -EBADMSG) {
+ if (IN_SET(r, -EBADMSG, -EADDRNOTAVAIL)) {
log_debug_errno(r, "Skipping message we can't read: %m");
r = 0;
goto finish;
@@ -1204,7 +1204,7 @@ static int output_cat_field(
get_log_colors(prio, &color_on, &color_off, &highlight_on);
r = sd_journal_get_data(j, field, &data, &l);
- if (r == -EBADMSG) {
+ if (IN_SET(r, -EBADMSG, -EADDRNOTAVAIL)) {
log_debug_errno(r, "Skipping message we can't read: %m");
return 0;
}
@@ -1276,7 +1276,7 @@ static int output_cat(
/* Determine priority of this entry, so that we can color it nicely */
r = sd_journal_get_data(j, "PRIORITY", &data, &l);
- if (r == -EBADMSG) {
+ if (IN_SET(r, -EBADMSG, -EADDRNOTAVAIL)) {
log_debug_errno(r, "Skipping message we can't read: %m");
return 0;
}
@@ -1420,7 +1420,7 @@ int show_journal_entry(
n_columns = columns();
r = get_display_timestamp(j, &display_ts, &boot_id);
- if (r == -EBADMSG) {
+ if (IN_SET(r, -EBADMSG, -EADDRNOTAVAIL)) {
log_debug_errno(r, "Skipping message we can't read: %m");
return 0;
}