Commit Diff
Diff:
950881c0d1c6b1fc1776b015583ae0a429be6aa1
f22153d05b19e9cb2b60d14429a1693b7bf4d52d
Commit:
f22153d05b19e9cb2b60d14429a1693b7bf4d52d
Tree:
269dea96af1b6fac0ab09331f04652212ed54983
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Sun Apr 13 12:58:37 2014 UTC
Message:
* we only want to print _anything_ in debug mode, do more debug wraps
blob - 948c5aaa2503b8035d3d2f4f0caa8f52d06ee508
blob + a5252e57cb8a7fb8ac5de5fc4e816d915f933fe8
--- parse.y
+++ parse.y
@@ -58,7 +58,7 @@ typedef struct {
int lineno;
} YYSTYPE;
-static const char rcsid[] = "$Id: parse.y,v 1.5 2014/04/13 12:24:15 pjp Exp $";
+static const char rcsid[] = "$Id: parse.y,v 1.6 2014/04/13 12:58:37 pjp Exp $";
static int version = 0;
static int state = 0;
static uint8_t region = 0;
@@ -335,7 +335,8 @@ zonestatement:
}
} else {
- printf("2 another record I don't know about?");
+ if (debug)
+ printf("2 another record I don't know about?");
return (-1);
}
@@ -360,7 +361,7 @@ zonestatement:
return -1;
}
- if(debug)
+ if (debug)
printf("%s PTR\n", $1);
} else if (strcasecmp($3, "cname") == 0) {
@@ -372,7 +373,8 @@ zonestatement:
printf("%s CNAME\n", $3);
} else {
- printf("%s other\n", $3);
+ if (debug)
+ printf("%s other\n", $3);
return -1;
}
@@ -524,7 +526,8 @@ loggingstatement:
}
} else {
- printf("another logging statement I don't know?\n");
+ if (debug)
+ printf("another logging statement I don't know?\n");
return (-1);
}
@@ -616,7 +619,8 @@ loggingstatement:
freeaddrinfo(res0);
}
} else {
- printf("2 another logging statement I don't know?\n");
+ if (debug)
+ printf("2 another logging statement I don't know?\n");
return (-1);
}
}
@@ -1062,11 +1066,17 @@ yylex()
if (inet_net_pton(AF_INET6, buf, &dst, sizeof(dst)) == -1) {
if (errno == EAFNOSUPPORT &&
temp_inet_net_pton_ipv6(buf, &dst, sizeof(dst)) != -1)
- printf("returning IPV6\n");
+#if LEXDEBUG
+ if (debug)
+ printf("returning IPV6\n");
+#endif
return IPV6;
} else {
- printf("returning IPV6\n");
+#if LEXDEBUG
+ if (debug)
+ printf("returning IPV6\n");
+#endif
return IPV6;
}
}
@@ -2191,7 +2201,8 @@ get_prefixlen(char *input, char *prefixlength, int pls
if (errno == EAFNOSUPPORT) {
prefixlen = temp_inet_net_pton_ipv6(input, prefixlength, plsize);
} else {
- printf("not address family %d (%s)\n", af, input);
+ if (debug)
+ printf("not address family %d (%s)\n", af, input);
return (NULL);
}
}
repomaster@centroid.eu