]> git.ozlabs.org Git - ccan/blobdiff - tools/tools.c
ccanlint: optimize the timeout case
[ccan] / tools / tools.c
index 769d6aeee7b1535ad191c3c22167ccb616ed283c..5db43df08b20ed8b45139055ee42c58d463322cc 100644 (file)
@@ -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);