]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_setopt: provide helper output in debug builds
authorDaniel Stenberg <daniel@haxx.se>
Mon, 14 Dec 2020 13:10:33 +0000 (14:10 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 18 Dec 2020 08:58:04 +0000 (09:58 +0100)
... for when setopt() returns error.

src/tool_setopt.c

index b9c3054703c47aa8cc10778ca666613d7590bb5e..196affc04244fd7b68ced25a459f6569bc99376e 100644 (file)
@@ -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;
 }