summaryrefslogtreecommitdiff
path: root/src/journal-remote/journal-upload-journal.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 11:58:34 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 12:04:41 +0100
commit0a1beeb64207eaa88ab9236787b1cbc2f704ae14 (patch)
tree50117277be2e2078d0373b944a30b4f09bb94443 /src/journal-remote/journal-upload-journal.c
parentb4d23205f238e06aaa31264628e20669e714acad (diff)
treewide: auto-convert the simple cases to log_*_errno()
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
Diffstat (limited to 'src/journal-remote/journal-upload-journal.c')
-rw-r--r--src/journal-remote/journal-upload-journal.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/journal-remote/journal-upload-journal.c b/src/journal-remote/journal-upload-journal.c
index 1cd52db2c1..290cfb9f56 100644
--- a/src/journal-remote/journal-upload-journal.c
+++ b/src/journal-remote/journal-upload-journal.c
@@ -26,7 +26,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
r = sd_journal_get_cursor(u->journal, &u->current_cursor);
if (r < 0) {
- log_error("Failed to get cursor: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get cursor: %m");
return r;
}
@@ -52,7 +52,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
r = sd_journal_get_realtime_usec(u->journal, &realtime);
if (r < 0) {
- log_error("Failed to get realtime timestamp: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get realtime timestamp: %m");
return r;
}
@@ -79,7 +79,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
r = sd_journal_get_monotonic_usec(u->journal, &monotonic, &boot_id);
if (r < 0) {
- log_error("Failed to get monotonic timestamp: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get monotonic timestamp: %m");
return r;
}
@@ -106,7 +106,7 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
r = sd_journal_get_monotonic_usec(u->journal, NULL, &boot_id);
if (r < 0) {
- log_error("Failed to get monotonic timestamp: %s", strerror(-r));
+ log_error_errno(-r, "Failed to get monotonic timestamp: %m");
return r;
}
@@ -305,7 +305,7 @@ static int process_journal_input(Uploader *u, int skip) {
r = sd_journal_next_skip(u->journal, skip);
if (r < 0) {
- log_error("Failed to skip to next entry: %s", strerror(-r));
+ log_error_errno(-r, "Failed to skip to next entry: %m");
return r;
} else if (r < skip)
return 0;
@@ -321,7 +321,7 @@ int check_journal_input(Uploader *u) {
r = sd_journal_process(u->journal);
if (r < 0) {
- log_error("Failed to process journal: %s", strerror(-r));
+ log_error_errno(-r, "Failed to process journal: %m");
close_journal_input(u);
return r;
}
@@ -364,7 +364,7 @@ int open_journal_for_upload(Uploader *u,
if (follow) {
fd = sd_journal_get_fd(j);
if (fd < 0) {
- log_error("sd_journal_get_fd failed: %s", strerror(-fd));
+ log_error_errno(-fd, "sd_journal_get_fd failed: %m");
return fd;
}
@@ -380,7 +380,7 @@ int open_journal_for_upload(Uploader *u,
r = sd_event_add_io(u->events, &u->input_event,
fd, events, dispatch_journal_input, u);
if (r < 0) {
- log_error("Failed to register input event: %s", strerror(-r));
+ log_error_errno(-r, "Failed to register input event: %m");
return r;
}