diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2019-04-16 17:06:01 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2019-04-24 21:38:24 +0000 |
commit | 5464535205261308d020bbe0e2a08962f78ab27e (patch) | |
tree | 8ac969a52a30930fc37ef8cee75511fb278e363e /src/libotutil/otutil.h | |
parent | d69214ade3d5b187ebfbb791d7cfb36155c4f8dd (diff) | |
download | ostree-5464535205261308d020bbe0e2a08962f78ab27e.tar.gz |
lib: Add ot_journal_* helper macros
Rather than wrapping each instance of `sd_journal_*` with
`HAVE_SYSTEMD`, let's just add some convenience macros that are just
no-op if we're not compiling with systemd.
Closes: #1841
Approved by: cgwalters
Diffstat (limited to 'src/libotutil/otutil.h')
-rw-r--r-- | src/libotutil/otutil.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libotutil/otutil.h b/src/libotutil/otutil.h index d648932e..eced95f9 100644 --- a/src/libotutil/otutil.h +++ b/src/libotutil/otutil.h @@ -44,6 +44,14 @@ } \ } G_STMT_END; +#ifdef HAVE_LIBSYSTEMD +#define ot_journal_send(...) sd_journal_send(__VA_ARGS__) +#define ot_journal_print(...) sd_journal_print(__VA_ARGS__) +#else +#define ot_journal_send(...) {} +#define ot_journal_print(...) {} +#endif + #include <ot-keyfile-utils.h> #include <ot-gio-utils.h> #include <ot-fs-utils.h> |