summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-17 23:36:25 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-18 19:49:30 -0400
commit763c7aa288485cf5ab627fe1d25ff58e76f9dacb (patch)
tree563130863f8763af93df272c0122c76ef25aaba0 /src/shared/util.h
parenta50d7d4389217c0d3b527ee260eabf89e4a76caa (diff)
journal,shared: add _cleanup_journal_close_
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 8ac4bbc249..4be0b61773 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -36,6 +36,7 @@
#include <dirent.h>
#include <sys/resource.h>
#include <stddef.h>
+#include <systemd/sd-journal.h>
#include "macro.h"
#include "time-util.h"
@@ -531,6 +532,10 @@ static inline void umaskp(mode_t *u) {
umask(*u);
}
+static inline void journal_closep(sd_journal **j) {
+ sd_journal_close(*j);
+}
+
_malloc_ static inline void *malloc_multiply(size_t a, size_t b) {
if (_unlikely_(b == 0 || a > ((size_t) -1) / b))
return NULL;