]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
client: add logging function to allow linking with memory.o
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Aug 2015 13:43:39 +0000 (15:43 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 5 Aug 2015 16:07:39 +0000 (18:07 +0200)
client.c

index 004cade7d45bf6e88b21b2fa7dfdce299101302e..32092f1bc48d675ee741ee35e1c1ed728ec4edb3 100644 (file)
--- a/client.c
+++ b/client.c
@@ -31,6 +31,7 @@
 #include "sysincl.h"
 
 #include "candm.h"
+#include "logging.h"
 #include "nameserv.h"
 #include "hash.h"
 #include "getdate.h"
@@ -69,6 +70,24 @@ static int no_dns = 0;
 
 static int recv_errqueue = 0;
 
+/* ================================================== */
+/* Log a message. This is a minimalistic replacement of the logging.c
+   implementation to avoid linking with it and other modules. */
+
+int log_debug_enabled = 0;
+
+void LOG_Message(LOG_Severity severity, LOG_Facility facility,
+                 int line_number, const char *filename,
+                 const char *function_name, const char *format, ...)
+{
+  va_list ap;
+
+  va_start(ap, format);
+  vfprintf(stderr, format, ap);
+  putc('\n', stderr);
+  va_end(ap);
+}
+
 /* ================================================== */
 /* Read a single line of commands from standard input.  Eventually we
    might want to use the GNU readline library. */