summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/coredumpctl.c1
-rw-r--r--src/journal/journal-internal.h6
-rw-r--r--src/journal/test-journal-enum.c1
3 files changed, 8 insertions, 0 deletions
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 99ca269327..97d967db3c 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -35,6 +35,7 @@
#include "path-util.h"
#include "pager.h"
#include "macro.h"
+#include "journal-internal.h"
static enum {
ACTION_NONE,
diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h
index 3accf14c05..ff8b34a951 100644
--- a/src/journal/journal-internal.h
+++ b/src/journal/journal-internal.h
@@ -132,3 +132,9 @@ struct sd_journal {
char *journal_make_match_string(sd_journal *j);
void journal_print_header(sd_journal *j);
+
+static inline void journal_closep(sd_journal **j) {
+ sd_journal_close(*j);
+}
+
+#define _cleanup_journal_close_ _cleanup_(journal_closep)
diff --git a/src/journal/test-journal-enum.c b/src/journal/test-journal-enum.c
index 88f583e6c7..bd1f5199e5 100644
--- a/src/journal/test-journal-enum.c
+++ b/src/journal/test-journal-enum.c
@@ -25,6 +25,7 @@
#include "sd-journal.h"
#include "macro.h"
#include "util.h"
+#include "journal-internal.h"
int main(int argc, char *argv[]) {
unsigned n = 0;