From: David Schleef Date: Fri, 22 Nov 2002 06:48:39 +0000 (+0000) Subject: fix mmap testing X-Git-Tag: r0_7_21~295 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=087e6042d440e5618155ebbf54938b7265a9bf67;p=comedilib.git fix mmap testing --- 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