aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libfetch/common.h2
-rw-r--r--lib/libfetch/fetch.c1
-rw-r--r--lib/libfetch/fetch.h3
3 files changed, 5 insertions, 1 deletions
diff --git a/lib/libfetch/common.h b/lib/libfetch/common.h
index 6dad6845a6b1..84b2e01478e7 100644
--- a/lib/libfetch/common.h
+++ b/lib/libfetch/common.h
@@ -59,7 +59,7 @@ int _fetch_add_entry(struct url_ent **, int *, int *,
#define _url_seterr(n) _fetch_seterr(_url_errlist, n)
#ifndef NDEBUG
-#define DEBUG(x) do x; while (0)
+#define DEBUG(x) do { if (fetchDebug) { x; } } while (0)
#else
#define DEBUG(x) do { } while (0)
#endif
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index b0b2057c5781..9941ab528bde 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -45,6 +45,7 @@ int fetchLastErrCode;
char fetchLastErrString[MAXERRSTRING];
int fetchTimeout;
int fetchRestartCalls = 1;
+int fetchDebug;
/*** Local data **************************************************************/
diff --git a/lib/libfetch/fetch.h b/lib/libfetch/fetch.h
index cca0d1f2c95f..3899ccac3cfe 100644
--- a/lib/libfetch/fetch.h
+++ b/lib/libfetch/fetch.h
@@ -136,4 +136,7 @@ extern char fetchLastErrString[MAXERRSTRING];
extern int fetchTimeout;
extern int fetchRestartCalls;
+/* Extra verbosity */
+extern int fetchDebug;
+
#endif