aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWojciech Kosior <kwojtus@protonmail.com>2020-05-07 19:53:51 +0200
committerWojciech Kosior <kwojtus@protonmail.com>2020-05-07 19:53:51 +0200
commitc0e1c65491f9d6726b16f107c25f2e5787e7e2ec (patch)
treef5bb3e414d47c49e4c555e5fc221c83ab00fcbf3 /src
parentdb227f3f975bb4be122711658efc8b03909851eb (diff)
download0tdns-c0e1c65491f9d6726b16f107c25f2e5787e7e2ec.tar.gz
0tdns-c0e1c65491f9d6726b16f107c25f2e5787e7e2ec.zip
add mock of our logging facility
Diffstat (limited to 'src')
-rw-r--r--src/0tDNS.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/0tDNS.c b/src/0tDNS.c
index b4bbf42..fbd3a78 100644
--- a/src/0tDNS.c
+++ b/src/0tDNS.c
@@ -26,6 +26,11 @@
#include <stdbool.h>
#include <unbound.h>
+#include "log.h"
+
+/* To specify when creating unbound context - has nothing to do with
+ * out logging facility
+ */
#define DEFAULT_DEBUGLEVEL 0
/*
@@ -234,8 +239,13 @@ struct ztdns_instance *ztdns_create_instance(int argc, char **argv)
struct ztdns_resolver *tmp;
ztdns = malloc(sizeof(struct ztdns_instance));
- if (!ztdns)
+ if (!ztdns) {
+ /* This is an example of how rest of the code shold be
+ * written/rewritten to use our logging facility.
+ */
+ ztdns_log(ERROR, "No memory, no fun :(\n");
return NULL;
+ }
/* Create context for performing full resolution */
ztdns->ctx_full =