summaryrefslogtreecommitdiffstats
path: root/src/journal
diff options
context:
space:
mode:
authorMike Yuan <me@yhndnzj.com>2024-08-17 19:53:09 +0200
committerMike Yuan <me@yhndnzj.com>2024-08-22 20:33:22 +0200
commitfad3feec120f9ab1174d993ff80be70493cddaec (patch)
treecbf0ec5d3c5a123a68f60d9336ffb14eb7625eff /src/journal
parentbasic/sigbus: use FOREACH_ELEMENT where appropriate, assert >= 0 for success (diff)
downloadsystemd-fad3feec120f9ab1174d993ff80be70493cddaec.tar.xz
systemd-fad3feec120f9ab1174d993ff80be70493cddaec.zip
shared/logs-show: introduce journal_browse_prepare()
which combines sigbus_install() and bumping fd limit.
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/bsod.c5
-rw-r--r--src/journal/journalctl-util.c7
2 files changed, 3 insertions, 9 deletions
diff --git a/src/journal/bsod.c b/src/journal/bsod.c
index 2116c498a4..cdf9e4874c 100644
--- a/src/journal/bsod.c
+++ b/src/journal/bsod.c
@@ -20,7 +20,6 @@
#include "parse-argument.h"
#include "pretty-print.h"
#include "qrcode-util.h"
-#include "sigbus.h"
#include "signal-util.h"
#include "sysctl-util.h"
#include "terminal-util.h"
@@ -307,12 +306,12 @@ static int run(int argc, char *argv[]) {
log_setup();
- sigbus_install();
-
r = parse_argv(argc, argv);
if (r <= 0)
return r;
+ journal_browse_prepare();
+
r = acquire_first_emergency_log_message(&message);
if (r < 0)
return r;
diff --git a/src/journal/journalctl-util.c b/src/journal/journalctl-util.c
index b554f4d78a..1996bddf60 100644
--- a/src/journal/journalctl-util.c
+++ b/src/journal/journalctl-util.c
@@ -8,7 +8,6 @@
#include "journalctl-util.h"
#include "logs-show.h"
#include "rlimit-util.h"
-#include "sigbus.h"
#include "strv.h"
#include "terminal-util.h"
@@ -27,11 +26,7 @@ int acquire_journal(sd_journal **ret) {
assert(ret);
- /* Increase max number of open files if we can, we might needs this when browsing journal files, which might be
- * split up into many files. */
- (void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
-
- sigbus_install();
+ journal_browse_prepare();
if (arg_directory)
r = sd_journal_open_directory(&j, arg_directory, arg_journal_type | arg_journal_additional_open_flags);