Add syslog support
Signed-off-by: Mrunal Patel <mpatel@redhat.com>
This commit is contained in:
parent
8d275cebb9
commit
562f8ca684
1 changed files with 11 additions and 8 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include <sys/epoll.h>
|
#include <sys/epoll.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <syslog.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
@ -17,12 +18,14 @@
|
||||||
#define pexit(fmt, ...) \
|
#define pexit(fmt, ...) \
|
||||||
do { \
|
do { \
|
||||||
fprintf(stderr, "conmon: " fmt " %m\n", ##__VA_ARGS__); \
|
fprintf(stderr, "conmon: " fmt " %m\n", ##__VA_ARGS__); \
|
||||||
|
syslog(LOG_ERR, "conmon <error>: " fmt ": %m\n", ##__VA_ARGS__); \
|
||||||
exit(EXIT_FAILURE); \
|
exit(EXIT_FAILURE); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define nexit(fmt, ...) \
|
#define nexit(fmt, ...) \
|
||||||
do { \
|
do { \
|
||||||
fprintf(stderr, "conmon: " fmt "\n", ##__VA_ARGS__); \
|
fprintf(stderr, "conmon: " fmt "\n", ##__VA_ARGS__); \
|
||||||
|
syslog(LOG_ERR, "conmon <error>: " fmt " \n", ##__VA_ARGS__); \
|
||||||
exit(EXIT_FAILURE); \
|
exit(EXIT_FAILURE); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue