Re: [RFC/PATCH] transport-helper: initialize debug flag before starting threads
- From
Jeff King <peff@peff.net>
- Date
- Dec 8, 2014, 10:36 UTC
- Message-ID
- <20141208103624.GA11737@peff.net>
- In-Reply-To
- <20141208082206.GA28302@peff.net>
On Mon, Dec 08, 2014 at 03:22:06AM -0500, Jeff King wrote:
Show 13 quoted lines
> /* Print bidirectional transfer loop debug message. */
> __attribute__((format (printf, 1, 2)))
> static void transfer_debug(const char *fmt, ...)
> {
> va_list args;
> char msgbuf[PBUFFERSIZE];
> - static int debug_enabled = -1;
>
> - if (debug_enabled < 0)
> - debug_enabled = getenv("GIT_TRANSLOOP_DEBUG") ? 1 : 0;
> - if (!debug_enabled)
> + if (!transport_debug_enabled)
> return;I think in my cover letter I made clear that this was not really meant for inclusion as-is, but just in case: this obviously is missing "()" at the end of the function call (interestingly gcc -Wall complains, but clang does not).
-Peff