From 2cf4172a71860c6e44edd27a3b68047ae062d7fc Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 5 Jan 2015 00:52:47 +0100 Subject: journal: install sigbus handler for journal tools too This makes them robust regarding truncation. Ideally, we'd export this as an API, but given how messy SIGBUS handling is, and the uncertain ownership logic of signal handlers we should not do this (unless libc one day invents a scheme how to sanely install SIGBUS handlers for specific memory areas only). However, for now we can still make all our own tools robust. Note that external tools will only have read-access to the journal anyway, where SIGBUS is much more unlikely, given that only writes are subject to disk full problems. --- src/journal/journalctl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/journal/journalctl.c') diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 7b67bc1dab..c91f2cf938 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -54,6 +54,7 @@ #include "pager.h" #include "strv.h" #include "set.h" +#include "sigbus.h" #include "journal-internal.h" #include "journal-def.h" #include "journal-verify.h" @@ -1723,6 +1724,7 @@ int main(int argc, char *argv[]) { goto finish; signal(SIGWINCH, columns_lines_cache_reset); + sigbus_install(); if (arg_action == ACTION_NEW_ID128) { r = generate_new_id128(); -- cgit v1.2.3-54-g00ecf