shared/logs-show: introduce journal_browse_prepare()

which combines sigbus_install() and bumping fd limit.
This commit is contained in:
Mike Yuan
2024-08-22 20:33:22 +02:00
parent d71f138156
commit fad3feec12
11 changed files with 32 additions and 47 deletions
+2 -5
View File
@@ -53,7 +53,6 @@
#include "process-util.h"
#include "ptyfwd.h"
#include "rlimit-util.h"
#include "sigbus.h"
#include "signal-util.h"
#include "sort-util.h"
#include "stdio-util.h"
@@ -2430,14 +2429,12 @@ static int run(int argc, char *argv[]) {
setlocale(LC_ALL, "");
log_setup();
/* The journal merging logic potentially needs a lot of fds. */
(void) rlimit_nofile_bump(HIGH_RLIMIT_NOFILE);
sigbus_install();
r = parse_argv(argc, argv);
if (r <= 0)
return r;
journal_browse_prepare();
if (STRPTR_IN_SET(argv[optind],
"import-tar", "import-raw", "import-fs",
"export-tar", "export-raw",