X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Fasync.c;h=f3d1a5ba13b36354d23bdf309ae28d8c75617bd3;hb=HEAD;hp=d867079d0782c4f341e9af443517494f52f83c78;hpb=daf9ee7d8e2b683ff05283beb1843611ad8c9e8a;p=ccan diff --git a/tools/ccanlint/async.c b/tools/ccanlint/async.c index d867079d..3f88bbcd 100644 --- a/tools/ccanlint/async.c +++ b/tools/ccanlint/async.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -34,7 +35,7 @@ struct command { const void *ctx; }; -static void killme(int sig) +static void killme(int sig UNNEEDED) { kill(-getpid(), SIGKILL); } @@ -150,11 +151,12 @@ static void reap_output(void) int old_len, len; /* This length includes nul terminator! */ old_len = tal_count(c->output); - tal_resize(&c->output, old_len + 1024); - len = read(c->output_fd, c->output + old_len - 1, 1024); + tal_resize(&c->output, old_len + 65536); + len = read(c->output_fd, c->output + old_len - 1, 65536); if (len < 0) err(1, "Reading from async command"); - tal_resize(&c->output, old_len + len); + if (len != 65536) + tal_resize(&c->output, old_len + len); c->output[old_len + len - 1] = '\0'; if (len == 0) { struct rusage ru;