summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Cook <ariscop@gmail.com>2013-09-04 23:27:52 +1000
committerHarald Hoyer <harald@redhat.com>2013-09-06 10:09:55 +0200
commit92f2ff4415b43e3265da0a1f09b24635f0874d55 (patch)
tree117b6a5f5615d039f63a1cadb8f6cfb089eb0d5f /src
parentca0ceb6f3e7e8ffda57b18c2dfe72dfb9de08f35 (diff)
systemd-coredump: Log crashes without coredumps on failure
Make a best-effort attempt to store information about crashes during failure, currently if these are encountered the crash is completely silenced. ideally coredumpctl would show if a coredump is available.
Diffstat (limited to 'src')
-rw-r--r--src/journal/coredump.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index a7d3c34fe4..68c353fe83 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -241,7 +241,7 @@ int main(int argc, char* argv[]) {
coredump_data = malloc(coredump_bufsize);
if (!coredump_data) {
r = log_oom();
- goto finish;
+ goto finalize;
}
memcpy(coredump_data, "COREDUMP=", 9);
@@ -261,12 +261,12 @@ int main(int argc, char* argv[]) {
if(coredump_size > COREDUMP_MAX) {
log_error("Coredump too large, ignoring");
- goto finish;
+ goto finalize;
}
if (!GREEDY_REALLOC(coredump_data, coredump_bufsize, coredump_size + 1)) {
r = log_oom();
- goto finish;
+ goto finalize;
}
}
@@ -274,6 +274,7 @@ int main(int argc, char* argv[]) {
iovec[j].iov_len = coredump_size;
j++;
+finalize:
r = sd_journal_sendv(iovec, j);
if (r < 0)
log_error("Failed to send coredump: %s", strerror(-r));