From 92ee7edb3a85d458fe7a456a9e9b4a6bb9351059 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 9 Apr 2010 14:12:53 +0930 Subject: [PATCH] ccanlint: optimize the timeout case This takes my "make fastcheck" from about 57 seconds to about 43 seconds. --- tools/tools.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/tools.c b/tools/tools.c index 769d6aee..5db43df0 100644 --- a/tools/tools.c +++ b/tools/tools.c @@ -145,6 +145,8 @@ char *run_command(const void *ctx, unsigned int *time_ms, const char *fmt, ...) if (!time_ms) time_ms = &default_time; + else if (*time_ms == 0) + return talloc_strdup(ctx, "\n== TIMED OUT ==\n"); va_start(ap, fmt); cmd = talloc_vasprintf(ctx, fmt, ap); -- 2.39.2