mirror of
https://github.com/systemd/systemd.git
synced 2025-03-22 06:50:18 +03:00
journald: reuse IOVEC_TOTAL_SIZE() macros where possible
This commit is contained in:
parent
2678031a17
commit
8266e1c04d
@ -521,12 +521,7 @@ static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned
|
||||
}
|
||||
|
||||
if (vacuumed || !shall_try_append_again(f, r)) {
|
||||
size_t size = 0;
|
||||
unsigned i;
|
||||
for (i = 0; i < n; i++)
|
||||
size += iovec[i].iov_len;
|
||||
|
||||
log_error_errno(r, "Failed to write entry (%d items, %zu bytes), ignoring: %m", n, size);
|
||||
log_error_errno(r, "Failed to write entry (%d items, %zu bytes), ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -539,14 +534,9 @@ static void write_to_journal(Server *s, uid_t uid, struct iovec *iovec, unsigned
|
||||
|
||||
log_debug("Retrying write.");
|
||||
r = journal_file_append_entry(f, NULL, iovec, n, &s->seqnum, NULL, NULL);
|
||||
if (r < 0) {
|
||||
size_t size = 0;
|
||||
unsigned i;
|
||||
for (i = 0; i < n; i++)
|
||||
size += iovec[i].iov_len;
|
||||
|
||||
log_error_errno(r, "Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %m", n, size);
|
||||
} else
|
||||
if (r < 0)
|
||||
log_error_errno(r, "Failed to write entry (%d items, %zu bytes) despite vacuuming, ignoring: %m", n, IOVEC_TOTAL_SIZE(iovec, n));
|
||||
else
|
||||
server_schedule_sync(s, priority);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user