Browse Source

ccanlint: optimize the timeout case

This takes my "make fastcheck" from about 57 seconds to about 43 seconds.
Rusty Russell 16 years ago
parent
commit
92ee7edb3a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      tools/tools.c

+ 2 - 0
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);