X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Fverify-state.c;h=734c1e4c77fa81c791f62d4e784f060d4256c6a9;hb=8e4b2e55512f1b75e99a9c4fe1fd7af5e05ecc4d;hp=d744e6f12f6465a7b6b05f3d248dffea371e0b62;hpb=b06370ef479196773ee45d2d68d57e098e0f8d1e;p=fio.git diff --git a/t/verify-state.c b/t/verify-state.c index d744e6f1..734c1e4c 100644 --- a/t/verify-state.c +++ b/t/verify-state.c @@ -27,7 +27,9 @@ static void show_s(struct thread_io_list *s, unsigned int no_s) printf("Index:\t\t%llu\n", (unsigned long long) s->index); printf("Completions:\n"); - for (i = 0; i < s->no_comps; i++) { + if (!s->no_comps) + return; + for (i = s->no_comps - 1; i >= 0; i--) { printf("\t(file=%2llu) %llu\n", (unsigned long long) s->comps[i].fileno, (unsigned long long) s->comps[i].offset); @@ -56,7 +58,8 @@ static void show(struct thread_io_list *s, size_t size) show_s(s, no_s); no_s++; size -= __thread_io_list_sz(s->depth, s->nofiles); - s = (void *) s + __thread_io_list_sz(s->depth, s->nofiles); + s = (struct thread_io_list *)((char *) s + + __thread_io_list_sz(s->depth, s->nofiles)); } while (size != 0); } @@ -116,10 +119,12 @@ static int show_file(const char *file) if (ret < 0) { log_err("read: %s\n", strerror(errno)); close(fd); + free(buf); return 1; } else if (ret != sb.st_size) { log_err("Short read\n"); close(fd); + free(buf); return 1; }