summaryrefslogtreecommitdiffstats
path: root/src/journal-remote/journal-upload-journal.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 17:09:20 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 17:17:51 +0100
commitc33b329709ebe2755181980a050d02ec7c81ed87 (patch)
tree39080c428c72c90daddbe1c08d45c181adf1476c /src/journal-remote/journal-upload-journal.c
parenthostnamectl: Exit with zero on success (diff)
downloadsystemd-c33b329709ebe2755181980a050d02ec7c81ed87.tar.xz
systemd-c33b329709ebe2755181980a050d02ec7c81ed87.zip
treewide: more log_*_errno() conversions, multiline calls
Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
Diffstat (limited to 'src/journal-remote/journal-upload-journal.c')
-rw-r--r--src/journal-remote/journal-upload-journal.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c
index ace31af0bf..6e5e45f7c9 100644
--- a/src/journal-remote/journal-upload-journal.c
+++ b/src/journal-remote/journal-upload-journal.c
@@ -134,8 +134,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
&u->field_data,
&u->field_length);
if (r < 0) {
- log_error("Failed to move to next field in entry: %s",
- strerror(-r));
+ log_error_errno(r, "Failed to move to next field in entry: %m");
return r;
} else if (r == 0) {
u->entry_state = ENTRY_OUTRO;
@@ -250,8 +249,7 @@ static size_t journal_input_callback(void *buf, size_t size, size_t nmemb, void
if (u->entry_state == ENTRY_DONE) {
r = sd_journal_next(j);
if (r < 0) {
- log_error("Failed to move to next entry in journal: %s",
- strerror(-r));
+ log_error_errno(r, "Failed to move to next entry in journal: %m");
return CURL_READFUNC_ABORT;
} else if (r == 0) {
if (u->input_event)
@@ -392,8 +390,8 @@ int open_journal_for_upload(Uploader *u,
if (cursor) {
r = sd_journal_seek_cursor(j, cursor);
if (r < 0) {
- log_error("Failed to seek to cursor %s: %s",
- cursor, strerror(-r));
+ log_error_errno(r, "Failed to seek to cursor %s: %m",
+ cursor);
return r;
}
}