From 562f8ca68444ededd09ff8111011be5c2fc13f96 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Mon, 14 Nov 2016 16:02:03 -0800 Subject: [PATCH] Add syslog support Signed-off-by: Mrunal Patel --- conmon/conmon.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/conmon/conmon.c b/conmon/conmon.c index 0ef15d60..a9caf29e 100644 --- a/conmon/conmon.c +++ b/conmon/conmon.c @@ -9,21 +9,24 @@ #include #include #include +#include #include #include #include -#define pexit(fmt, ...) \ - do { \ - fprintf(stderr, "conmon: " fmt " %m\n", ##__VA_ARGS__); \ - exit(EXIT_FAILURE); \ +#define pexit(fmt, ...) \ + do { \ + fprintf(stderr, "conmon: " fmt " %m\n", ##__VA_ARGS__); \ + syslog(LOG_ERR, "conmon : " fmt ": %m\n", ##__VA_ARGS__); \ + exit(EXIT_FAILURE); \ } while (0) -#define nexit(fmt, ...) \ - do { \ - fprintf(stderr, "conmon: " fmt "\n", ##__VA_ARGS__); \ - exit(EXIT_FAILURE); \ +#define nexit(fmt, ...) \ + do { \ + fprintf(stderr, "conmon: " fmt "\n", ##__VA_ARGS__); \ + syslog(LOG_ERR, "conmon : " fmt " \n", ##__VA_ARGS__); \ + exit(EXIT_FAILURE); \ } while (0) #define nwarn(fmt, ...) \