diff options
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/catalog.c | 8 | ||||
-rw-r--r-- | src/journal/coredumpctl.c | 4 | ||||
-rw-r--r-- | src/journal/journalctl.c | 8 | ||||
-rw-r--r-- | src/journal/journald-server.c | 8 | ||||
-rw-r--r-- | src/journal/sd-journal.c | 12 |
5 files changed, 19 insertions, 21 deletions
diff --git a/src/journal/catalog.c b/src/journal/catalog.c index f16e28a7a8..67bf4ba017 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -348,8 +348,8 @@ static long write_catalog(const char *database, Hashmap *h, struct strbuf *sb, r = fopen_temporary(database, &w, &p); if (r < 0) { - log_error("Failed to open database for writing: %s: %s", - database, strerror(-r)); + log_error_errno(r, "Failed to open database for writing: %s: %m", + database); return r; } @@ -687,8 +687,8 @@ int catalog_list_items(FILE *f, const char *database, bool oneline, char **items k = sd_id128_from_string(*item, &id); if (k < 0) { - log_error("Failed to parse id128 '%s': %s", - *item, strerror(-k)); + log_error_errno(k, "Failed to parse id128 '%s': %m", + *item); if (r == 0) r = k; continue; diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c index b82c6f4530..edc12fead6 100644 --- a/src/journal/coredumpctl.c +++ b/src/journal/coredumpctl.c @@ -830,8 +830,8 @@ int main(int argc, char *argv[]) { SET_FOREACH(match, matches, it) { r = sd_journal_add_match(j, match, strlen(match)); if (r != 0) { - log_error("Failed to add match '%s': %s", - match, strerror(-r)); + log_error_errno(r, "Failed to add match '%s': %m", + match); goto end; } } diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 1fdd7fc5c8..96b0ddd80f 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1662,8 +1662,7 @@ static int access_check(sd_journal *j) { assert(err > 0); if (err != EACCES) - log_warning("Error was encountered while opening journal files: %s", - strerror(err)); + log_warning_errno(err, "Error was encountered while opening journal files: %m"); } return r; @@ -1814,9 +1813,8 @@ int main(int argc, char *argv[]) { else r = sd_journal_open(&j, !arg_merge*SD_JOURNAL_LOCAL_ONLY + arg_journal_type); if (r < 0) { - log_error("Failed to open %s: %s", - arg_directory ? arg_directory : arg_file ? "files" : "journal", - strerror(-r)); + log_error_errno(r, "Failed to open %s: %m", + arg_directory ? arg_directory : arg_file ? "files" : "journal"); return EXIT_FAILURE; } diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c index f30a3c1392..4f5d002d21 100644 --- a/src/journal/journald-server.c +++ b/src/journal/journald-server.c @@ -308,11 +308,11 @@ static int do_rotate(Server *s, JournalFile **f, const char* name, r = journal_file_rotate(f, s->compress, seal); if (r < 0) if (*f) - log_error("Failed to rotate %s: %s", - (*f)->path, strerror(-r)); + log_error_errno(r, "Failed to rotate %s: %m", + (*f)->path); else - log_error("Failed to create new %s journal: %s", - name, strerror(-r)); + log_error_errno(r, "Failed to create new %s journal: %m", + name); else server_fix_perms(s, *f, uid); return r; diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 61e64f7f7c..d171600eef 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -1466,8 +1466,8 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname) dirent_is_file_with_suffix(de, ".journal~")) { r = add_file(j, m->path, de->d_name); if (r < 0) { - log_debug("Failed to add file %s/%s: %s", - m->path, de->d_name, strerror(-r)); + log_debug_errno(r, "Failed to add file %s/%s: %m", + m->path, de->d_name); r = set_put_error(j, r); if (r < 0) return r; @@ -1556,8 +1556,8 @@ static int add_root_directory(sd_journal *j, const char *p) { dirent_is_file_with_suffix(de, ".journal~")) { r = add_file(j, m->path, de->d_name); if (r < 0) { - log_debug("Failed to add file %s/%s: %s", - m->path, de->d_name, strerror(-r)); + log_debug_errno(r, "Failed to add file %s/%s: %m", + m->path, de->d_name); r = set_put_error(j, r); if (r < 0) return r; @@ -2218,8 +2218,8 @@ static void process_inotify_event(sd_journal *j, struct inotify_event *e) { if (e->mask & (IN_CREATE|IN_MOVED_TO|IN_MODIFY|IN_ATTRIB)) { r = add_file(j, d->path, e->name); if (r < 0) { - log_debug("Failed to add file %s/%s: %s", - d->path, e->name, strerror(-r)); + log_debug_errno(r, "Failed to add file %s/%s: %m", + d->path, e->name); set_put_error(j, r); } |