From 087e6042d440e5618155ebbf54938b7265a9bf67 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Fri, 22 Nov 2002 06:48:39 +0000 Subject: [PATCH] fix mmap testing --- testing/mmap.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/testing/mmap.c b/testing/mmap.c index 8f68c32..6268efb 100644 --- a/testing/mmap.c +++ b/testing/mmap.c @@ -55,13 +55,15 @@ void setup_segfaulter(void) int test_mmap(void) { comedi_cmd cmd; - char *buf; + unsigned char *buf; unsigned int chanlist[1]; int go; + int fails; int total=0; int ret; - void *b, *adr; - sampl_t *map; + void *b; + unsigned char *adr; + unsigned char *map; unsigned int flags; int i; @@ -88,7 +90,7 @@ int test_mmap(void) } /* test readability */ - for(adr=map;adr<(void *)map+MAPLEN;adr+=PAGE_SIZE){ + for(adr=map;adr10)break; } } - if(go) printf("compare ok\n"); + if(fails==0) printf("compare ok\n"); munmap(map,MAPLEN); /* test if area is really unmapped */ - for(adr=map;adr<(void *)map+MAPLEN;adr+=PAGE_SIZE){ + for(adr=map;adr