shared/logs-show: introduce journal_browse_prepare()
which combines sigbus_install() and bumping fd limit.
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
|
||||
#include "macro.h"
|
||||
#include "output-mode.h"
|
||||
#include "rlimit-util.h"
|
||||
#include "set.h"
|
||||
#include "sigbus.h"
|
||||
#include "time-util.h"
|
||||
|
||||
typedef struct LogId {
|
||||
@@ -124,3 +126,11 @@ static inline int journal_get_boots(
|
||||
advance_older, max_ids,
|
||||
ret_ids, ret_n_ids);
|
||||
}
|
||||
|
||||
static inline void journal_browse_prepare(void) {
|
||||
/* 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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user