summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-12-14 14:10:33 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-17 14:39:10 +0100
commit5365eb3d1f58e759ae1f5ea847922402744b8aa9 (patch)
treef8eb5cc3102e9fbc35361c8e528292fbaa9d38a8
parentab7e4792ed00417e88701d25dedf450b65ed17ba (diff)
downloadcurl-5365eb3d1f58e759ae1f5ea847922402744b8aa9.tar.gz
tool_setopt: provide helper output in debug builds
... for when setopt() returns error.
-rw-r--r--src/tool_setopt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tool_setopt.c b/src/tool_setopt.c
index b9c305470..196affc04 100644
--- a/src/tool_setopt.c
+++ b/src/tool_setopt.c
@@ -31,6 +31,7 @@
#include "tool_easysrc.h"
#include "tool_setopt.h"
#include "tool_convert.h"
+#include "tool_msgs.h"
#include "memdebug.h" /* keep this as LAST include */
@@ -315,7 +316,11 @@ CURLcode tool_setopt_enum(CURL *curl, struct GlobalConfig *config,
}
}
- nomem:
+#ifdef DEBUGBUILD
+ if(ret)
+ warnf(config, "option %s returned error (%d)\n", name, (int)ret);
+#endif
+ nomem:
return ret;
}