diff options
author | ngie <ngie@FreeBSD.org> | 2015-05-13 11:49:38 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-05-13 11:49:38 +0000 |
commit | db9d37a97890cb058f3b4016f3ed97da1d6cb728 (patch) | |
tree | 825bdd00a7e056401953de24324c6e6a7015badc /tools | |
parent | 9c310a16d768c7e42572fcdbeef5e96f3e6ed62e (diff) | |
download | FreeBSD-src-db9d37a97890cb058f3b4016f3ed97da1d6cb728.zip FreeBSD-src-db9d37a97890cb058f3b4016f3ed97da1d6cb728.tar.gz |
MFC r280894,r280895:
r280894:
Minor cleanup before converting to ATF testcases
- Remove blank (tab-only) lines.
- Fix -Wunused warnings.
- Bump up to WARNS= 6
r280895:
- Fix -Wsign issue
- Bump up to WARNS=6
Diffstat (limited to 'tools')
-rw-r--r-- | tools/regression/aio/kqueue/Makefile | 4 | ||||
-rw-r--r-- | tools/regression/aio/kqueue/aio_kqueue.c | 2 | ||||
-rw-r--r-- | tools/regression/aio/kqueue/lio/Makefile | 2 | ||||
-rw-r--r-- | tools/regression/aio/kqueue/lio/lio_kqueue.c | 37 |
4 files changed, 27 insertions, 18 deletions
diff --git a/tools/regression/aio/kqueue/Makefile b/tools/regression/aio/kqueue/Makefile index 00e24d6..39c1aa1 100644 --- a/tools/regression/aio/kqueue/Makefile +++ b/tools/regression/aio/kqueue/Makefile @@ -3,4 +3,8 @@ PROG= aio_kqueue MAN= +WARNS?= 6 + +SUBDIR+= lio + .include <bsd.prog.mk> diff --git a/tools/regression/aio/kqueue/aio_kqueue.c b/tools/regression/aio/kqueue/aio_kqueue.c index d24e97b..87b4125 100644 --- a/tools/regression/aio/kqueue/aio_kqueue.c +++ b/tools/regression/aio/kqueue/aio_kqueue.c @@ -177,7 +177,7 @@ main (int argc, char *argv[]) #endif if (result != sizeof(buffer)) { printf("FAIL: run %d, operation %d, result %d " - " (errno=%d) should be %d\n", run, pending, + " (errno=%d) should be %zu\n", run, pending, result, errno, sizeof(buffer)); failed++; } else diff --git a/tools/regression/aio/kqueue/lio/Makefile b/tools/regression/aio/kqueue/lio/Makefile index 4d64a0c..da054e4 100644 --- a/tools/regression/aio/kqueue/lio/Makefile +++ b/tools/regression/aio/kqueue/lio/Makefile @@ -3,4 +3,6 @@ PROG= lio_kqueue MAN= +WARNS?= 6 + .include <bsd.prog.mk> diff --git a/tools/regression/aio/kqueue/lio/lio_kqueue.c b/tools/regression/aio/kqueue/lio/lio_kqueue.c index b486ec3..ad7fc68 100644 --- a/tools/regression/aio/kqueue/lio/lio_kqueue.c +++ b/tools/regression/aio/kqueue/lio/lio_kqueue.c @@ -37,13 +37,15 @@ * http://www.ambrisko.com/doug/listio_kqueue/listio_kqueue.patch */ -#include <aio.h> -#include <fcntl.h> -#include <stdio.h> -#include <errno.h> #include <sys/types.h> #include <sys/event.h> #include <sys/time.h> +#include <aio.h> +#include <fcntl.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <unistd.h> #define PATH_TEMPLATE "/tmp/aio.XXXXXXXXXX" @@ -52,9 +54,10 @@ #define MAX LIO_MAX * 16 #define MAX_RUNS 300 +int main(int argc, char *argv[]){ int fd; - struct aiocb *iocb[MAX], *kq_iocb; + struct aiocb *iocb[MAX]; struct aiocb **lio[LIO_MAX], **lio_element, **kq_lio; int i, result, run, error, j, k; char buffer[32768]; @@ -65,7 +68,7 @@ main(int argc, char *argv[]){ time_t time1, time2; char *file, pathname[sizeof(PATH_TEMPLATE)-1]; int tmp_file = 0, failed = 0; - + if (kq < 0) { perror("No kqeueue\n"); exit(1); @@ -89,7 +92,7 @@ main(int argc, char *argv[]){ #ifdef DEBUG printf("Hello kq %d fd %d\n", kq, fd); #endif - + for (run = 0; run < MAX_RUNS; run++){ #ifdef DEBUG printf("Run %d\n", run); @@ -137,13 +140,13 @@ main(int argc, char *argv[]){ printf("write %d is at %p\n", j, lio[j]); #endif } - + for(i = 0; i < LIO_MAX; i++) { for(j = LIO_MAX - 1; j >=0; j--) { if (lio[j]) break; } - + for(;;) { bzero(&ke, sizeof(ke)); bzero(&kq_returned, sizeof(ke)); @@ -169,18 +172,18 @@ main(int argc, char *argv[]){ kq_returned.udata, lio[j]); #endif - + if(kq_lio) break; #ifdef DEBUG printf("Try again\n"); #endif - } - + } + #ifdef DEBUG printf("lio %p\n", lio); #endif - + for (j = 0; j < LIO_MAX; j++) { if (lio[j] == kq_lio) { break; @@ -201,12 +204,12 @@ main(int argc, char *argv[]){ printf("PASS: run %d, operation %d result %d \n", run, LIO_MAX - i -1, result); } for(k = 0; k < MAX / LIO_MAX; k++){ - result = aio_return(kq_lio[k]); + result = aio_return(kq_lio[k]); #ifdef DEBUG printf("Return Resulto for %d %d is %d\n", j, k, result); #endif if (result != sizeof(buffer)) { - printf("FAIL: run %d, operation %d sub-opt %d result %d (errno=%d) should be %d\n", + printf("FAIL: run %d, operation %d sub-opt %d result %d (errno=%d) should be %zu\n", run, LIO_MAX - i -1, k, result, errno, sizeof(buffer)); } else { printf("PASS: run %d, operation %d sub-opt %d result %d\n", @@ -216,13 +219,13 @@ main(int argc, char *argv[]){ #ifdef DEBUG printf("\n"); #endif - + for(k = 0; k < MAX / LIO_MAX; k++) { free(lio[j][k]); } free(lio[j]); lio[j] = NULL; - } + } } #ifdef DEBUG printf("Done\n"); |