From 8bc29add2abf434390b3e6696ff7b364d658f028 Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Thu, 19 Sep 2013 10:10:16 -0400 Subject: Creat a thin logging layer When qarshd is run via xinetd, stderr still goes out the socket and messages from sockutil.c or qarsh_packet.c can interfere with the protocol. Create a thin wrapper which qacp and qarsh can send to stderr and qarshd can send to syslog. --- qacp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'qacp.c') diff --git a/qacp.c b/qacp.c index b8b006a..4e9c95d 100644 --- a/qacp.c +++ b/qacp.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "sockutil.h" @@ -52,6 +53,17 @@ int qacp_fd = -1; /* The control connection to qacpd */ unsigned short qarsh_ss_family; /* AF_INET/AF_INET6, set on connect */ short quiet = 0; +void +lprintf(int priority, const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); +} + + void usage() { -- cgit