From dfb33a9737e62ab872d3937b7690b252d2892fe8 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Apr 2013 05:25:57 +0200 Subject: macro: rework how we define cleanup macros There's now a generic _cleanup_ macro with an argument. The macros for specific types are now defined using this macro, and in the header files where they belong. All cleanup handlers are now inline functions. --- src/journal/journal-internal.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/journal/journal-internal.h') 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) -- cgit v1.2.3-54-g00ecf