1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

In the test harness, do the back-substitution (@TESTDIR@, @PREFIX@) also on the

live VERBOSE output, not just the post-mortem dumps.
This commit is contained in:
Petr Rockai 2012-02-15 01:31:10 +00:00
parent ad48a46fc9
commit a635143d62

View File

@ -119,6 +119,14 @@ static void dump(void) {
} }
} }
static void trickle() {
static int counter_last = -1, counter = 0;
while ( counter < readbuf_used && counter != counter_last ) {
counter_last = counter;
counter = outline( readbuf, counter, 1 );
}
}
static void clear(void) { static void clear(void) {
readbuf_used = 0; readbuf_used = 0;
} }
@ -131,12 +139,12 @@ static void drain(void) {
sz = read(fds[1], buf, sizeof(buf)); sz = read(fds[1], buf, sizeof(buf));
if (sz <= 0) if (sz <= 0)
return; return;
if (verbose)
write(1, buf, sz);
if (readbuf_used + sz >= readbuf_sz) { if (readbuf_used + sz >= readbuf_sz) {
readbuf_sz = readbuf_sz ? 2 * readbuf_sz : 4096; readbuf_sz = readbuf_sz ? 2 * readbuf_sz : 4096;
readbuf = realloc(readbuf, readbuf_sz); readbuf = realloc(readbuf, readbuf_sz);
} }
if (verbose)
trickle();
if (!readbuf) if (!readbuf)
exit(205); exit(205);
memcpy(readbuf + readbuf_used, buf, sz); memcpy(readbuf + readbuf_used, buf, sz);