From c33b329709ebe2755181980a050d02ec7c81ed87 Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 17:09:20 +0100 Subject: 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. --- src/journal-remote/journal-upload-journal.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/journal-remote/journal-upload-journal.c') 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; } } -- cgit v1.2.3-54-g00ecf