summaryrefslogtreecommitdiffstats
path: root/qacp.c
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2013-09-19 10:10:16 -0400
committerNathan Straz <nstraz@redhat.com>2013-09-19 10:26:32 -0400
commit8bc29add2abf434390b3e6696ff7b364d658f028 (patch)
treefaa927113db114a7d1ed4c03f9196def61692a95 /qacp.c
parent486049502c9156e1309a81651f014f2d4fd4450e (diff)
downloadqarsh-8bc29add2abf434390b3e6696ff7b364d658f028.tar.gz
qarsh-8bc29add2abf434390b3e6696ff7b364d658f028.tar.xz
qarsh-8bc29add2abf434390b3e6696ff7b364d658f028.zip
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.
Diffstat (limited to 'qacp.c')
-rw-r--r--qacp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/qacp.c b/qacp.c
index b8b006a..4e9c95d 100644
--- a/qacp.c
+++ b/qacp.c
@@ -40,6 +40,7 @@
#include <pwd.h>
#include <sys/sendfile.h>
#include <libgen.h>
+#include <stdarg.h>
#include "sockutil.h"
@@ -53,6 +54,17 @@ 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()
{
/* printf("usage: qacp: [-r] [[user@]host1:]file1 [...] " */