* link to systemd instead of systemd-journal on newer systemspull/2/merge
parent
fff1a1053b
commit
5fdcc82edd
@ -0,0 +1,63 @@
|
||||
#ifndef JOURNALD_NATIVE_SD_JOURNAL_H
|
||||
#define JOURNALD_NATIVE_SD_JOURNAL_H
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
/* do the real stuff */
|
||||
|
||||
#include "extconf.h"
|
||||
|
||||
/* check for extconf results */
|
||||
|
||||
#ifndef HAVE_SYSTEMD_SD_JOURNAL_H
|
||||
#error Cannot include <systemd/sd-journal.h>. Please use linux version with systemd-journal installed
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SD_JOURNAL_PRINT
|
||||
#error Required function sd_journal_print is missing
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SD_JOURNAL_SENDV
|
||||
#error Required function sd_journal_sendv is missing
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_SD_JOURNAL_PERROR
|
||||
#error Required function sd_journal_perror is missing
|
||||
#endif
|
||||
|
||||
/* include systemd-journal headers */
|
||||
|
||||
#include <systemd/sd-journal.h>
|
||||
|
||||
#else
|
||||
|
||||
#warning Compiling dummy version of the gem for non-Linux OS
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
/* use dummy */
|
||||
#define JOURNALD_NATIVE_SYSTEMD_JOURNAL_DUMMY
|
||||
|
||||
/* syslog constants */
|
||||
#define LOG_EMERG 0
|
||||
#define LOG_ALERT 1
|
||||
#define LOG_CRIT 2
|
||||
#define LOG_ERR 3
|
||||
#define LOG_WARNING 4
|
||||
#define LOG_NOTICE 5
|
||||
#define LOG_INFO 6
|
||||
#define LOG_DEBUG 7
|
||||
|
||||
/* iovec */
|
||||
struct iovec {
|
||||
void *iov_base; /* Starting address */
|
||||
size_t iov_len; /* Number of bytes to transfer */
|
||||
};
|
||||
|
||||
int sd_journal_print(int priority, const char *format, ...);
|
||||
int sd_journal_sendv(const struct iovec *iov, int n);
|
||||
int sd_journal_perror(const char *message);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -0,0 +1,9 @@
|
||||
#include "sd_journal.h"
|
||||
|
||||
#ifdef JOURNALD_NATIVE_SYSTEMD_JOURNAL_DUMMY
|
||||
|
||||
int sd_journal_print(int priority, const char *format, ...) { return 0; }
|
||||
int sd_journal_sendv(const struct iovec *iov, int n) { return 0; }
|
||||
int sd_journal_perror(const char *message) { return 0; }
|
||||
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
module Journald
|
||||
module Native
|
||||
VERSION = '1.0.2'
|
||||
VERSION = '1.0.3'
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in new issue