summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-11 19:34:17 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:56:54 -0400
commit872c8faaf2009422a91d227ae0b5c6f04c9d2c69 (patch)
treea6b03abbcd801638098ec591f48873b39f6a0dcd /src/journal
parent51d122af23533b0b8318911c4fc8b128ad8eafb7 (diff)
Fix write-only use of a few variables
Since the invention of read-only memory, write-only memory has been considered deprecated. Where appropriate, either make use of the value, or avoid writing it, to make it clear that it is not used.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/coredump.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index 68c353fe83..733373b307 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -240,7 +240,7 @@ int main(int argc, char* argv[]) {
coredump_bufsize = COREDUMP_MIN_START;
coredump_data = malloc(coredump_bufsize);
if (!coredump_data) {
- r = log_oom();
+ log_warning("Failed to allocate memory for core, core will not be stored.");
goto finalize;
}
@@ -251,7 +251,7 @@ int main(int argc, char* argv[]) {
n = loop_read(STDIN_FILENO, coredump_data + coredump_size,
coredump_bufsize - coredump_size, false);
if (n < 0) {
- log_error("Failed to read core dump data: %s", strerror(-n));
+ log_error("Failed to read core data: %s", strerror(-n));
r = (int) n;
goto finish;
} else if (n == 0)
@@ -259,13 +259,13 @@ int main(int argc, char* argv[]) {
coredump_size += n;
- if(coredump_size > COREDUMP_MAX) {
- log_error("Coredump too large, ignoring");
+ if (coredump_size > COREDUMP_MAX) {
+ log_error("Core too large, core will not be stored.");
goto finalize;
}
if (!GREEDY_REALLOC(coredump_data, coredump_bufsize, coredump_size + 1)) {
- r = log_oom();
+ log_warning("Failed to allocate memory for core, core will not be stored.");
goto finalize;
}
}
@@ -277,7 +277,7 @@ int main(int argc, char* argv[]) {
finalize:
r = sd_journal_sendv(iovec, j);
if (r < 0)
- log_error("Failed to send coredump: %s", strerror(-r));
+ log_error("Failed to log coredump: %s", strerror(-r));
finish:
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;